Градиентный метод первого порядка
Дипломная работа - Компьютеры, программирование
Другие дипломы по предмету Компьютеры, программирование
then Result:=-1Item1.toTask.StartTime>Item2.toTask.StartTime then Result:=1Result:=0:=Item1.toProc - Item1.fromProc;:=Item2.toProc - Item2.fromProc;D1>D2 then Result:=1D1PLT.StartTime then PLT.StartTime:=Time;:=PLT.StartTime+PLT.Length;;;
зrocedure TSubMerger.FormLinkTasksAndSetTimes(NumOfProcs:integer);i,j,k:integer;,toPPT:PProcTask;:PLinkTask;:PProcPoint;:PProcCon;:PHolder;: pointer;:TList;(true);(false);NumOfProcs<>0 then:=TList.Create;;.Add(list);i:=1 to NumOfProcs-1 do:=TList.Create;;.Add(list);:=TList.Create;.Add(List);;i:=0 to AllProcTasks.Count-1 do:=AllProcTasks[i];:=Procs[PPT.ProcNum-1];
List.Add(PPT);;
// Формированик Линков
for i:=1 to Procs.Count-1 do:=Procs[i];j:=0 to List.Count-1 do:=List[j];:=GetProcPointByUIN(PPT.UIN);:=PPP.Prev;PPC0 then:=List.last;NumOfRows<PPT.StartTime+PPT.Length then
NumOfRows:=PPT.StartTime+PPT.Length;;;i:=0 to Links.Count-1 do:=Links[i];List.Count<>0 then:=List.last;NumOfRows<PLT.StartTime+PLT.Length then
NumOfRows:=PLT.StartTime+PLT.Length;;;
// Чистим сетку //.RowCount:=NumOfRows;Procs.Count1 then.FixedCols:=1;.FixedRows:=1;;
// Выводi:=0 to Procs.Count-1 do:=Procs[i];j:=0 to List.Count-1 do:=List[j];k:=PPT.StartTime to PPT.StartTime+PPT.Length-1 do.Cells[2*i+1,k]:=inttostr(PPT.UIN);Selected = PPT then SG.Cells[2*i+1,k]:='s'+SG.Cells[2*i+1,k]PPT.MayBeAfter then SG.Cells[2*i+1,k]:='m'+SG.Cells[2*i+1,k];;i:=0 to Links.Count-1 do:=Links[i];j:=0 to List.Count-1 do:=List[j];k:=PLT.StartTime to PLT.StartTime+PLT.Length-1 do.Cells[2*i+2,k]:=inttostr(PLT.fromUIN)+':'+inttostr(PLT.toUIN);;;;TSubMerger.SelectTask(UIN:integer);i,j:integer;,tmpPPP:PProcPoint;,prevPPC:PProcCon;:PProcTask;:PHolder;:TList;,StartIndex,EndIndex:integer;:boolean;:=GetProcTaskByUIN(UIN);i:=0 to AllProcTasks.Count-1 do:=AllProcTasks[i];.MayBeAfter:= PPT.UINnil do.Add(PPC.toPoint);:=PPC.next;;
{ PPC:=PPP.Prev;PPCnil do.Add(PPC.toPoint);:=PPC.Next;;
//nil do.Add(PPC.toPoint);:=PPC.Next;;
}.Destroy;i:=1 to MinProcNum-1 do:=Procs[i-1];j:=0 to List.Count-1 do:= PProcTask(List[j]);.MayBeAfter:=false;.MayBeBefore:=false;;i:=MaxProcNum+1 to Procs.Count do:=Procs[i-1];j:=0 to List.Count-1 do:= PProcTask(List[j]);.MayBeAfter:=false;.MayBeBefore:=false;;i:=MinProcNum to MaxProcNum do:=Procs[i-1];:=false;j:=0 to List.Count-1 doSelected0)and(PProcTask(List.first).MayBeBefore)
or(Selected=List.first))then(PMT);.UIN:=UIN;.processor:=i+1;.afterUIN:=-1;.Time:=$7FFFFFFF;.ProcCount:=$7FFFFFFF;.CurrentState:=false;.Add(PMT);;;i:=0 to AllProcTasks.Count-1 do:=AllProcTasks[i];PPT.MayBeAfter then(PMT);.UIN:=UIN;.processor:=PPT.ProcNum;.afterUIN:=PPT.UIN;.Time:=$7FFFFFFF;.ProcCount:=$7FFFFFFF;.CurrentState:=false;.Add(PMT);;;;;TSubMerger.GetTime:integer;i:integer;:PProcTask;:TList;:=0;i:=0 to Procs.Count-1 do:=Procs[i];List.Count<>0 then:=List.Last;Result < PPT.StartTime+PPT.Length-1 then Result :=
PPT.StartTime+PPT.Length-1;;;TSubMerger.GetProcCount:integer;i:integer;:=0;i:=0 to Procs.Count-1 doTList(Procs[i]).Countnil)and(PPT.UIN=PPM.afterUIN))or
((PPT=nil)and(PPM.afterUIN=-1))then Unique:=false;;.CurrentState := not Unique;Unique thenPPM.afterUIN<>-1 then
(GetProcTaskByUIN(PPM.afterUIN)).MayBeAfter:=true;(PPM.processor,PPM.afterUIN);GetProcCountPPossibleMove(AllMoves[i]).Time then
MinTime:=PPossibleMove(AllMoves[i]).Time;
//-->>
{ Memo.Lines.Clear;i:=0 to AllMoves.Count-1 do:=AllMoves[i];.Lines.Add(inttostr(PPM.UIN)+' <>
'+inttostr(PPM.processor)+':'+inttostr(PPM.afterUIN)+' Time=
'+inttostr(PPM.Time)+' PC='+inttostr(PPM.ProcCount));PPM.CurrentState then Memo.Lines.Add('Was current state!')
end;}
//<<--
// выделяем минимальные времена:=0;
while iPPossibleMove(AllMoves[i]).ProcCount then