farnaz Posted June 21, 2017 Share Posted June 21, 2017 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 More sharing options...
gocken Posted June 21, 2017 Share Posted June 21, 2017 (edited) 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 June 22, 2017 by Guest Link to comment Share on other sites More sharing options...
farnaz Posted June 22, 2017 Author Share Posted June 22, 2017 I tried your solution and it works. Thank you so much Link to comment Share on other sites More sharing options...
dsturrock Posted July 6, 2017 Share Posted July 6, 2017 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 More sharing options...
Recommended Posts