Tony Huang
Tony Huang

Reputation: 25

AnyLogic: How can I set up a M/M/3 model

I have a M/M/3 model. One queue with three servers. The customer in the queue can goes to any one of the three clerk as long as it is empty. If I directly link the Out Port of the queue and all 3 delays In Port like this, there is an error message( error message). I tried to use Select Output5 but I don't know how to set up the properties. how should I set up this model?

Upvotes: 1

Views: 145

Answers (2)

Stuart Rossiter
Stuart Rossiter

Reputation: 2517

For a standard M/M/c case, your conception of using separate Delay blocks for each server is wrong; resource pools and Service blocks (or a single Delay block with a capacity) are 'designed' to model this. (There is one logical 'service' with a given capacity of how many it can handle at once.)

So in the simplest case, use a single Delay block with a capacity of 3 (with a preceding Queue). Or a single Service block with a Resource Pool of capacity 3 (where the Service seizes a single resource from that pool); this already intrinsically includes a queue.

You only need to consider separate Delay/Service blocks if they are actually different 'services' (so e.g., different delay time expressions or different resources used) or you want to associate them with specific animation locations.

In the latter case, you still wouldn't normally use separate Delay/Service blocks (which is forcing you to 'hardcode' a block per server): one way is to make your resource agents custom agents which hold their 'service location' (a Node) and initialise these as you need to. Then your process changes to a Seize --> MoveTo --> Delay --> Release sequence, with the Seize block seizing from the pool and the MoveTo block moving to the service location node stored in the seized resource. (There is obviously some detail in terms of how exactly to do this which I won't go into now because it may not be relevant for your question.)

Upvotes: 1

Felipe
Felipe

Reputation: 9421

enter image description here

wait block code on enter:

if(delay.size()==0 || delay1.size()==0 || delay2.size()==0){
    self.free(agent);
}

exit block code:

if(delay.size()==0)
    enter.take(agent);
else if(delay1.size()==0){
    enter1.take(agent);
}else if(delay2.size()==0 ){
    enter2.take(agent);
}

sink code:

wait.free(agent);

Each delay has a capacity of 1

Upvotes: 0

Related Questions