Jump to content

Routing based on time schedule


farnaz
 Share

Recommended Posts

Hello,


In my SIMIO model there is a decision point and in this point some entities will be accepted and some of them will be rejected. For accepted entities, there are 3 different routes through the 3 different servers. So, I would like to create a rule in this decision point as follows:

From 6am to 10am, entities would be accepted with probability (1-p1) and transferred to server A. So, entities would be rejected with probability p1.

From 10am to 6pm, entities would be accepted with probability (1-p2) and transferred to server B. So, entities would be rejected with probability p2.

From 6pm to 10pm, entities would be accepted with probability (1-p3) and transferred to server C. So, entities would be rejected with probability p3.

So, I do not know how to determine the time schedule for link weight for each rout.


I really appreciate if anyone can help me,

Link to comment
Share on other sites

For the link weight to the serverA use Math.If(((Math.Remainder(TimeNow, 24 )>6)&&(Math.Remainder(TimeNow, 24 )<=10)), (1-p1), 0 ) as the selection weight expression and then use p1 as the selection weight to the sink object (representing rejected entities).

For the link weight to the serverB use Math.If(((Math.Remainder(TimeNow, 24 )>10)&&(Math.Remainder(TimeNow, 24 )<=18)), (1-p2), 0) as the selection weight expression and then use p2 as the selection weight to the sink object (representing rejected entities).

For the first link weight to the serverC use Math.If(((Math.Remainder(TimeNow, 24 )>18)&&(Math.Remainder(TimeNow, 24 )<=22)), (1-p3), 0 ) as the selection weight expression and then use p3 as the selection weight to the sink object (representing rejected entities).

Edited by Guest
Link to comment
Share on other sites

  • 2 weeks later...

A slightly more efficient and easier to read version of the same logic:

Math.If(((DateTime.Hour(TimeNow)>6)&&(DateTime.Hour(TimeNow)<=10)), (1-p1), 0 )


Or shorter:

((DateTime.Hour(TimeNow)>6)&&(DateTime.Hour(TimeNow)<=10))*(1-p1)

Link to comment
Share on other sites

×
×
  • Create New...