Alex, since AIMMS supports procedural language, it should be no problem to implement the logic.
Maybe more concrete about your questions?
Hi @deannezhang ,
my bproblem is how to keep track of the current workload on each machine, update it correctly for the next period and how to simulate that an order after a certain amount of time periods moves on to another station, according to the routing of the order (which also influences the current workload on the stations.
I hope this makes my question a bit more clear :)
If workload(m,t) is the workload of each machine for each period, and you want to use the current period load to initilize the next period, you can use
for t do:
if ord(t)=0 then
workload(m,t) := initialworkload(m,t);
else
workload(m,t) :=workload(m,t-1);
endif
endfor;
for your second question, you want to track the status of order, whichever way is convenient for you to implement the algorithm. for example:
- an element parameter range over period, to track when an order starts on a machine: epOrderStartsOnMachine(o,m)
- an element parameter range over machine, for each order’s machine at t: epOrderOnMachine(o,t)
- an element parameter, range over machine, for the routing of the order: epOrderNextMachine(o,m)
- a parameter for the lengh of an order on machine: pOrderProcessTime(o,m)
Hope this is helpful.
Hey @deannezhang ,
Thank you very much for your answers so far, really helped a lot. However i have one last question, if you dont mind.
When checking if an order needs to be shifted to the next Station, i have setup this For-Loop:
for (j in OrdersInProduction) do
if (TimeOfOrderOnStation(i,j) >= ProcessTimeOfOrder(i,j)) then
OrderOnStation(j,t) := OrderNextStation(j,i);
else
OrderOnStation ((j,t) | t >= '2022-07-01 02') := OrderOnStation(j, t-1);
endif;
I get the error message Index i has not been specified, which is expected since i hadnt specified it, but i dont know where or how to specify it correctly in that case. (i is the index for my Workstations btw.)
Do you know where i made a mistake or how i can solve this error message ?
Thank you once again for your time and patients.
At each t, an order is on one certain station, using an element perameter OrderOnStation(j,t) , ranged over set Station, to track the station. Then the code will be like:
for (j in OrdersInProduction) do
if (TimeOfOrderOnStation(OrderOnStation(j,t),j) >= ProcessTimeOfOrder(OrderOnStation(j,t) ,j)) then
OrderOnStation(j,t) := OrderNextStation(j,OrderOnStation(j,t) );
else
OrderOnStation ((j,t) | t >= '2022-07-01 02') := OrderOnStation(j, t-1);
endif;
Deanne
At each t, an order is on one certain station, using an element perameter OrderOnStation(j,t) , ranged over set Station, to track the station. Then the code will be like:
for (j in OrdersInProduction) do
if (TimeOfOrderOnStation(OrderOnStation(j,t),j) >= ProcessTimeOfOrder(OrderOnStation(j,t) ,j)) then
OrderOnStation(j,t) := OrderNextStation(j,OrderOnStation(j,t) );
else
OrderOnStation ((j,t) | t >= '2022-07-01 02') := OrderOnStation(j, t-1);
endif;
Deanne
Implementing this will give me the error: scope of index t has not been specified. (for the if-Statement). I tried to use an ElementParameter CurrentPeriod with the Range HourCalendar to fix this. This helps to remove the error, but the data for parameter OrderOnStation(j,t) is completly empty then.
For reference: If an order gets released i assign the first station in the routing of order j to that order. That works but then i have this bit of code before i go into the next period and then the parameter data is completly empty.
Do you have any idea why that could be the case?
Kind regards
Alex
I assume t is the iterator in the algorithm? Then you will initialize the first t, such that the order is on the first machine. in case there is not enough machine initally, you may need a virtual machine to make sure all orders can be assigned. Then as the iteration goes on, result of t+1 will be generated based result of t.