anylogic

How can I use the .getServicedEntity() method on a Resource Unit without casting the agent type?

半腔热情 提交于 2020-05-17 08:49:16
问题 I built a custom block that, among other things, tells the resource entering portIn of the block to move to the resource's seizing unit. I use a moveTo block with the destination node as: (Node)((Cart)agent).getServicedEntity().getNetworkNode(); but I need to know the agent type and cast it into the method. I would like to make this a generic block that can be used in other models and with any Resource Unit. I've tried using generic parameters in the custom block then selecting the agent type

Anylogic: How to keep an agent waiting in queue until it changes state? (Discrete Events flowchart)

泪湿孤枕 提交于 2020-03-04 18:19:38
问题 I'm starting to use Anylogic for a simulation class, and for this I need to model the following behaviour: there's a stream of agents that enter a FIFO queue, and then enter into a server (that I modeled with a delay block), one at a time. The agents have two states (call them A and B), and if an agent reaches the end of the queue in state A, it has to wait until it returns to state B to go into the service. I think a wait block with capacity for one agent, between the queue and the delay

Anylogic: How to keep an agent waiting in queue until it changes state? (Discrete Events flowchart)

≯℡__Kan透↙ 提交于 2020-03-04 18:19:04
问题 I'm starting to use Anylogic for a simulation class, and for this I need to model the following behaviour: there's a stream of agents that enter a FIFO queue, and then enter into a server (that I modeled with a delay block), one at a time. The agents have two states (call them A and B), and if an agent reaches the end of the queue in state A, it has to wait until it returns to state B to go into the service. I think a wait block with capacity for one agent, between the queue and the delay

Anylogic simulate material stored in containers

懵懂的女人 提交于 2020-02-07 05:18:05
问题 I'm trying to simulate materials stored in containers on a shelf where the containers slide forward if you remove the first one. Example: A container can hold 10 elements and is filled by the batch-block. The container moves to the shelf(conveyor) where it should stay until it's empty. The assembly-block should take one piece out of the container and assemble the product. If the container is empty it can be dropped off the conveyor. I did try to model the shelf as a conveyor, which does work

Is there a way to return a list of the nodes along a network between an agent and it's destination?

北城以北 提交于 2020-01-25 04:40:06
问题 I'd like to return and capture a list of the path elements and nodes that an agent will travel if given a moveTo() command. From this list, I can see if the agent will pass through certain nodes where the agent will behave differently (slow down, pause for 1 minute, etc.). I can then cycle through moveTo() commands for each node and change the parameters based on the node it's going through. I'd love to give some sample code, but I'm not sure where to begin to get the list. TIA 回答1: You can

How do I prevent service block from starting

我与影子孤独终老i 提交于 2020-01-17 00:37:46
问题 I'm new to Anylogic, and I was wondering if it's possible to hold delay process when the shift is over eve if the process already started. I'm trying to write some code in the service action but i don't find the correct code lines. i expect the flow process should stop until the next resource shift will start. 回答1: You can do that using the custom resource choice in the service block: self.delayTime(agent)<schedule.getTimeoutToNextValue() This means that a resource can only be chosen if the

Can you connect 2 separate flowcharts with one restricted area?

我只是一个虾纸丫 提交于 2020-01-15 10:23:12
问题 Our model has a ProductionOrder seize some Operators. The seize block has a Prepare flowchart for the Operators to move through an airlock (PAL) into a room. After the ProductionOrder operation (a delay block), the Operators are released and have a Wrap-Up flowchart that sends them out of the room through the same airlock. Because this airlock can only have 2 people, we need to restrict the combined Operators in the Prepare and Wrap-up flowcharts to 2 people in the airlock regardless of them

Managing multiple anylogic simulations within an experiment

我的未来我决定 提交于 2020-01-06 13:52:40
问题 We are developing an ABM under AnyLogic 7 and are at the point where we want to make multiple simulations from a single experiment. Different parameters are to be set for each simulation run so as to generate results for a small suite of standard scenarios. We have an experiment that auto-starts without the need to press the "Run". Subsequent pressing of the Run does increment the experiment counter and reruns the model. What we'd like is a way to have the auto-run, or single press of Run,

AnyLogic - Why does my condition based transition not work?

北城余情 提交于 2020-01-06 07:14:51
问题 I have a question related to a transition in my statechart (see image above). I have a variable called palletInUse which is a boolean-type and changes between true and false. For one transition in my statechart I want it to change when the variable palletInUse has the value true. I have tried it with for example: palletInUse == true; and also tried different code like, equals and contentEquals etc. but nothing seems to work. Do you have a solution for this, seemingly simple problem? Thanks in

How can I log my position regularly in a GIS Model?

大憨熊 提交于 2020-01-06 06:01:21
问题 I have a GIS model where a truck leaves a main distributor, visits several customers along a route to make deliveries, and then return to the distributor once it is empty. The route is chosen based on proximity of agents to the main distributor and to each other. I'm trying to figure out how to log the route the truck took in order to make the deliveries, though I have not been able to do so yet. Any help is greatly appreciated. Thank you! 回答1: If you want to log street names (as you do): You