Now I’m studying anylogic with book ‘Anylogic in three days’.
I followed the job shop example from the book ‘AnyLogic in Three Days’ and am now trying various things to do more.
I have a model where a ResourcePool has two home locations: nodeCNC1 and nodeCNC2. I want to set the value of variable ‘nodeCNC1State’ to 100 when the CNC at nodeCNC1 is ‘isBusy() = true’ and set the value of variable ‘nodeCNC2State’ to 100 when the CNC at nodeCNC2 is ‘isBusy() = true’. In all other cases, both variables should be 0. This is because I want to estimate the power consumption of the CNC machines when they are operating. Therefore, I want to update the variables when a job enters each node by coding it in the ‘On enter’ section of the Retrieve block.Could anyone please explain how to code this properly to call each node of the ResourcePool?
The overall picture of the model
ResourcePool – cnc
I tried,
Retrieve – Actions – On enter
if (cnc.homeNodes == nodeCNC1) {
nodeCNC1State = 100;
} else if (cnc.homeNodes == nodeCNC2) {
nodeCNC2State = 100;
}
Release – Actions – On enter
if (cnc.homeNodes == nodeCNC1) {
nodeCNC1State = 0;
} else if (cnc.homeNodes == nodeCNC2) {
nodeCNC2State = 0;
}
but it didn’t work..
부소연 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.