Discrete Event SImulation for Delphi Problem
Discrete Event Simulation for a factory:
Got a problem I want to press a button that will simulate the factory
jobs through a number of machines I have got the barebones of the
program written (email me if you need to see the additional code)
Below:
Is the pseudocode of what I need to do:
Make Production Plan
Read production requirement list (containing products)
initialise factory
initialise clockand date
initilalise productionlist
while (list not empty) do
for (next time slot) do
freemachines()
allocatejobstomachines();
outputdetailstoproductionplan();
advancetimeslot();
end for
end while
print production plan();
end;
freemachines()
for (allmachines) do
if (machineinuse) then
if (jobnowcompleted) then
setmachineavailable();
addservicebacktopool();
markthisstagecompleted();
end if
end if
end
allocatejobstomachines()
successs:=true
while success do
getprioritytask
assigntasktomachine (success)
end do
end
assigntasktomachine(sucess)
sucess:= machineavailable and serviceavailable
if sucess then
set machineavailable;
removeservicesfrompool
end if
end
Sent via Deja.com
http://www.deja.com/