I’m working on a simulation model in AnyLogic where I need to introduce a downtime period for cleaning when switching beer types in a cooling tank. I have set up a Downtime
block and a Seize
block, but the downtime does not seem to start as expected. Below are the details of my setup:
Setup:
-
Boolean Variable:
isCoolingNewDown
to track the downtime status.
-
Seize Block:
- Named
NewCoolerseize
. - Seizes resource
NewCoolerTank
. - Code in the
On enter
section checks if the beer type has changed and triggers the downtime.
- Named
if (!currentBeerTypeInNewCooler.equals(agent.BeerType)) {
System.out.println("Switch in beer type detected. Starting downtime...");
downtimeCleaningSwitchNewCooler.start(); // Trigger the downtime for cleaning
System.out.println("Downtime start() called.");
} else {
System.out.println("No switch in beer type.");
}
- Downtime Block:
- Named
downtimeCleaningSwitchNewCooler
. - Configured to handle the cleaning downtime.
- Actions on
On start
andOn finish
.
- Named
// On start
isCoolingNewDown = true;
System.out.println("isCoolingNewDown set to true.");
// On finish
isCoolingNewDown = false;
System.out.println("isCoolingNewDown set to false.");
- Resource Pool:
- Resource pool
NewCoolerTank
uses thedowntimeCleaningSwitchNewCooler
for downtime.
- Resource pool
Issue:
The downtime does not start as expected. The print statements in the On start
and On finish
sections of the downtime block are never executed, indicating that the downtime is not being triggered. Here are some additional details:
- The
Seize
block correctly identifies when the beer type changes and prints the corresponding messages. - The
start()
method on the downtime block does not seem to initiate the downtime.
What I have tried:
- Added print statements around the
start()
call to ensure it is being reached.
Question:
Why is the downtimeCleaningSwitchNewCooler.start()
method not initiating the downtime, and how can I correctly trigger the downtime for cleaning when switching beer types in my cooling tank?
user25621023 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.