Reputation: 1
in the following code I would like to add a command that after retStroage=orangeStorage which makes me delete the agents inside the orange storage how can I do?
int nRetrieved = nForRetrieve.getIntValue();
int storageSize = 0;
int b=orangeStorageSize;
int a=0;
Storage retStorage = null;
if (b == a) {
switch (retrieveRadio.getValue()) {
case 0:
retStorage = greenStorage;
break;
case 1:
retStorage = blueStorage;
break;
case 2:
retStorage = redStorage;
break;
}
}
else {
retStorage= orangeStorage;
v
}
storageSize = retStorage.size();
if (nRetrieved > storageSize)
nRetrieved = storageSize;
for (int i = storageSize; i > storageSize - nRetrieved; i--)
enter.take((SKU)retStorage.getAgents().get(i-1));
Upvotes: 0
Views: 92
Reputation: 12795
To remove agents from a storage, use the Retrieve
block, avoid using code (unless you know what you are doing), see https://anylogic.help/library-reference-guides/material-handling-library/retrieve.html#retrieve
Upvotes: 0