Stopping server in day time interval

198 views
Skip to first unread message

Damien s

unread,
Apr 18, 2016, 2:11:40 PM4/18/16
to Jaamsim Users Discussion Group
Hello,

I would like to stop server when the running time is bigger than 7h and the Server before is not working anymore.

I was trying to set OperatingThresholdList to 'this.SimTime > 7.5[h] && ![ServerBefore].Woeking && ![ServerThis].Working' and I get an error ""Could not find an Entity named: this.SimTime - Value will be cleared.

My simulation runs for 10 days in a row and I would like to know idle and working time when daily running time is bigger than 7.5h. And machine must be stopped, because no more entitys are comming. Otherwise the machine is always running and I get an output like this (10th day, after 7.5h):



But I need results like this



Is this possible and how?

Thank you
Damjan
Auto Generated Inline Image 1
Auto Generated Inline Image 2

Harry King

unread,
Apr 18, 2016, 5:11:53 PM4/18/16
to Jaamsim Users Discussion Group
Damjan,

Prior to release 2016-06, you could not use "this" in the input to the PauseCondition keyword. That is, you could enter '[Simulation].SimTime', but not 'this.SimTime'. This bug was fixed in release 2016-06.

The problem of using a time limit in the PauseCondition was discussed in an earlier post just a few days ago entitled "Assigning Priority in a single queue". Using a Controller object as discussed in this post is one solution to the problem. Another would be to use an EntityGenerator and EntitySink to create and destroy a single entity at 7.5 hours. Anything that will generate an event a this time would work.

Harry

ajm....@gmail.com

unread,
Apr 19, 2016, 6:45:49 AM4/19/16
to Jaamsim Users Discussion Group

Hello Harry,

You explained to me how can I set expression in simulation->pause condition. I was wondering how can I set something like TimeThreshold in OperatingThresholdList that will stop only the server, when condition is reached.

Should I use ExpressionThreshold? Can I use there in open condition also [Simulation].SimTime?

Damjan

Harry King

unread,
Apr 19, 2016, 12:54:27 PM4/19/16
to Jaamsim Users Discussion Group, ajm....@gmail.com
Damjan,

Yes, you can use a TimeSeries and a TimeSeriesThreshold to stop/start your server at a particular times. However, the condition for opening and closing the TimeSeriesThreshold is restricted to the values provided by the TimeSeries -- you cannot specify a complex expression. You may need to use both an ExpressionThreshold and a TimeSeriesThreshold in the Server's OperatingThresholdList to achieve the correct logic.

Harry

Damien s

unread,
Apr 19, 2016, 2:33:39 PM4/19/16
to Jaamsim Users Discussion Group, ajm....@gmail.com
Hello Harry,

but can I set that rule that both thresholds must be true to stop the server (time over 7,5h and if one server has queue empty)?

When the simulation starts the server should be working, it will stop after 7,5 hours when exprthreshold is reached. How can I achieve that?

Thank you
Damjan

Harry King

unread,
Apr 19, 2016, 2:52:55 PM4/19/16
to Jaamsim Users Discussion Group, ajm....@gmail.com
Damjan,

The solution to your problem is to use the state of the TimeSeriesThreshold in your ExpressionThreshold, i.e.

      '[TimeSeriesThreshold1].Open || ![Server1].Working'

The TimeSeries would be set up so that the the TimeSeriesThreshold is becomes closed at 7.5 hours. The ExpressionThreshold would then close when BOTH the TimeSeriesThreshold is closed and the Server is not working. Note that only the ExpressionThreshold should be included in the input to the Server's OperatingThresholdList keyword.

The TimeSeriesThreshold will create the necessary event at time 7.5 hours that will trigger the evaluation of the ExpressionThreshold condition.

Harry 

Damien s

unread,
Apr 19, 2016, 3:22:20 PM4/19/16
to Jaamsim Users Discussion Group, ajm....@gmail.com
Heello again,

I found another way. This is how I solved it.

1. I have a server that has a timeThreshold and stopes when the simulation time is bigger than 7,5h (server_1)
2. then I have another server (server_2) and queue (queue_server_2)
3. Then I set a new expressionThreshold with condition '[server_1].Open  || ![queue_server_2].QueueLength == 0'
4. The expression is now set in OperationThreshold in server_1

That works :)

Best regards
Damjan

Damien s

unread,
Apr 19, 2016, 3:43:45 PM4/19/16
to Jaamsim Users Discussion Group, ajm....@gmail.com
Hello Harry,

Thank for your solution. I didn'd know that I can use something like [TimeSeriesThreshold1].Open in ExpressionThreshold.

Thank you
Damjan

Harry King

unread,
Apr 19, 2016, 6:14:37 PM4/19/16
to Jaamsim Users Discussion Group, ajm....@gmail.com
Hi Damjan,

Yes, that allow's you to avoid defining the extra Server and Queue.

In general, you can use any Output in an expression that you see in the Output Viewer. The only requirement is that the Output returns either a number or a boolean.

Harry
Reply all
Reply to author
Forward
0 new messages