Reputation: 433
Utilizing a source
generating agents on an Interarrival time basis, I would like to stop the source
block from generating agents after a certain amount of time passing so that the model can continue to process the agents.
Upvotes: 0
Views: 522
Reputation: 12793
Sure. If it is a inter-arrival source block, make it use a variable as the interrarrival time, of type double:
Then, create an event that triggers once only, after your specific time. Make it change the variable to 0 as below. Make SURE to trigger it not at time 0 (as in the screen but when you need it!):
NOTE: Do not set myRate = 0;. Instead, set it to
infinity` to actually have no more arrivals.
Upvotes: 1
Reputation: 3930
One option to encapsulate all the logic inside the source block, without external events or variables, would be to select Multiple agents per arrival
as true and then have a conditional statement for the number of agents, for example time() > 10 ? 0 : 1
, so that after 10 model time units there will no agents arriving
Upvotes: 2