Model a task based on hours and resources assigned

885 views
Skip to first unread message

lsu...@gmail.com

unread,
Feb 9, 2016, 5:54:31 PM2/9/16
to Jaamsim Users Discussion Group
Just discovered Jaamsim and I'm pretty excited. I'm very new to the world of this type of simulation. I'm looking to model some building construction processes and am looking for some advice on the approach to take.

In the examples I've seen so far, the object is simulated as it moves thru the process. I'm looking to simulate the work effort needed for tasks.

Starting off: Have a task that takes X hours in an area. When that is finished, move to next area and do the next task, taking Y hours. Keep going until all tasks are done. I'd like to be able to adjust number of hours needed to do the task as well as number of resources (people) dedicated to that task. Workers working on the tasks will stick to a time based schedule on when they can do work.

Not looking for anyone to model it, but just looking for some advice on the direction to take and if its possible in Jaamsim.

Thanks

Harry King

unread,
Feb 9, 2016, 7:45:33 PM2/9/16
to Jaamsim Users Discussion Group, lsu...@gmail.com
lsuwest,

You should have no difficulty in modelling a construction process. You can capture all the details that would normally go into a CPM or PERT analysis. Here are some suggestions to get you started:
  • use a SimEntity to represent each of the sub-processes that you want to include in the model
  • groups of workers, equipment, specialized trades, etc. should be modelled as separate Resources
  • use the Seize and Release objects to set the resource requirements during each stage of the sub-processes.
  • use a separate TriangularDistribution for each task with an uncertain duration. This will allow you to specify the minimum, maximum, and most likely durations for the task in exactly the same way as a PERT analysis.
  • use an EntityGate and one or more ExpressionThresholds to model any precedence relationships
  • use the StateAssignment keyword to set the state of each process as it works its way through the tasks in each process, and an EntityLogger to record the state times once the process is finished.
  • use a SimEntity to represent the entire project and create the individual SimEntities for each sub-process using a Duplicate object
  • use a Combine object to recombine the individual SimEntities for each sub-process to detect the end of the project.
  • loop the project SimEntity back to the start of the model to initiate another pass through the project. This will allow you to execute the project thousands of times and obtain accurate statistics on the project duration, e.g. the minimum, maximum, and most likely values.
Let me know how this works out for you. Your model would make a good demo if you are willing to share it.

Harry

lsu...@gmail.com

unread,
Feb 10, 2016, 1:12:53 AM2/10/16
to Jaamsim Users Discussion Group, lsu...@gmail.com
Harry,

Thanks for the great tips. Looking forward to digging into the challenge. I expect it to be a slow build and learning experience, but I'll share what I can. I'm also positive that I'll have more questions.

Thanks!

Michael Zabritski

unread,
Feb 14, 2016, 4:02:04 PM2/14/16
to Jaamsim Users Discussion Group
Been jumping into this and am really loving the power of this tool. But with power comes a bit of complexity and I'm struggling with a few things.

1. Overall structure of tracking long tasks. Right now I'm running a single SimEntity as a single task with a long duration. I'm running it through a server to simulate the time. The server operatingthreshold is set to a TimeSeries to represent workers hours (a 12 hour day, from 6am - 6pm). The problem is that when the server shuts down, the server will finish the current task. This causes the task to finish sooner that it would in reality. Current ideas are to use expressions to break up the task time into smaller chunks with the the SimEntity attributes and keep running it through the server with a gate or branch. Also considered using attributes to adjust the service time to include non working hours, so the servicetime is longer than than the actual task time.

2. See a new downtime entity in 2016-2 that might help the above. Can't figure out its use from the manual and there are no examples of it in this group. Can you post an example?

3. I'm having a very difficult time with gates and expressionthresholds. My SimEntity (the task) loops thru the server, then an Assign Entity. An attribute called GateTime in the Assign Entity tracks the remaining hours left for that tasks. { 'this.GateTime=this.obj.TotalRemainingTime - this.obj.DailyTime' } I'm just trying to get an expressionthreshold to use GateTime to open or close the gate. If GateTime is =< 0 h, open the gate. It seems pretty simple, but I've read the expression section and looked at dozens of posts and I still can't get any expression to work or even be accepted.

I'll post what I have so far, but looks like I don't have that option yet.

Thanks.

Harry King

unread,
Feb 15, 2016, 4:25:04 PM2/15/16
to Jaamsim Users Discussion Group
Michael,

1. The OperatingThresholdList input is intended only to prevent a service activity from starting. Once started, it will always finish. If all the activities have the same working hours per day, then the easiest solution is to just ignore the non-working parts of the day. If that isn't appropriate, you can adjust the ExpressionThreshold to allow for the duration of the next task, so that a task is not started if it cannot finish before the end of the shift.

2. DowntimeEntity is a work-in-progress at the moment. None of the Process Flow objects have be programmed to use it yet.

3. You cannot rely on a ExpressionThreshold whose expression depends explicitly on SimTime or other measures of elapsed time. The problem is that the expression is evaluated only when an event occurs -- e.g. an entity arrives or departs, an activity starts or finishes, etc. This is what a "discrete-event" simulation is all about. If nothing else is happening, simulation time increases smoothly without generating any events. If possible, you should use a TimeSeries and a TimeSeriesThreshold instead of an ExpressionThreshold that depends on time. If that approach is not possible, then another solution is to add a Controller object (from the Calculation Objects palette) to your model. This object will generate events at regular intervals that will trigger the Expression Threshold to evaluate its expression.

Harry


Michael Zabritski

unread,
Feb 15, 2016, 7:43:47 PM2/15/16
to Jaamsim Users Discussion Group
Thanks Harry

Since my last post I was able to get a simple prototype working.  Since I'm still very much learning I'm going to assume that some of my solutions were brute force solutions and there are more elegant ways to solve this.  I'm treating time as the main tracking entity, accumulating it or subtracting it as the SimEntity goes thru Assigns.  My formulas are still not quite right (if a task only needs 1 more hour on hte last pass thru the server, it will accumulate a full days worth of work).   

My next steps are to build additional areas and then start working with multiple tasks following the first task.


Construction 2016-2 v3.cfg

Michael Zabritski

unread,
Feb 15, 2016, 7:56:04 PM2/15/16
to Jaamsim Users Discussion Group
The first attachment was missing a connection.  This one should work.  Another quick question:  Text3 is currently reading how much time until the gate opens (basically tasktimeremaining).  It is displaying in seconds, using the %s as the format.  What is the correct java format to display in hours?  I don't know Java yet and every format I've found online or in the user guide doesn't work.

Thanks again.
Construction 2016-2 v3.cfg

Harry King

unread,
Feb 16, 2016, 12:15:20 AM2/16/16
to Jaamsim Users Discussion Group
Michael,

Can you give me a brief description of the system you are trying to model? It might be easier if I built a demo model to get you started.

To convert your Text3 display from seconds to hours, set the UnitType to TimeUnit and set the Unit to h (for hours). If you set the Format input to '%.1f  h', then Text3 will display one decimal digit and append an "h" to remind the user that the display is in hours. Note that the Format input doesn't do the unit conversion -- it just indicates how to format the number and adds any additional text.

Harry

Michael Zabritski

unread,
Feb 16, 2016, 6:32:44 PM2/16/16
to Jaamsim Users Discussion Group
Thanks for the formatting help.  That makes sense now.  As for the model, I'm trying to model construction sequencing.  Task1 will go to AreaA.  In AreaA, taskA will take X amount of time and use X amount of workers, both adjustable. The more workers are used, the faster the task will be completed.  ( Example, Task1 hits AreaA with an assigned task time of 80 hours.  2 workers are assigned, so will be complete in 40 hours.)  Once AreaA is finished, Task1 will move to Areas B, C, D, etc... each with unique hours (potentially the same pool of workers.. not sure yet).    Once Task1 clears AreaA and moves to AreaB,  Task2 will enter AreaA and begin, using its own hours and separate workers.  Thinking that I'll need to model each Task on its own parallel path.   Follow this up with tasks3, 4, 5, etc... each moving thru the areas waiting for the task in front to finish.

I'm turning servers on and off and using smaller chunks of time for each server pass because I'm trying to model it to match real time and date.  I dont want task1 finished in 40 hours of simtime.  I'd like it finished in 40 hours of working time.

Thanks for all of your help so far.


Harry King

unread,
May 2, 2016, 1:43:05 AM5/2/16
to Jaamsim Users Discussion Group
Michael,

DowntimeEntity functions with Server and many other Process Flow palette objects in release 2016-10.

Harry

aaelkh...@gmail.com

unread,
Sep 18, 2017, 10:36:55 AM9/18/17
to Jaamsim Users Discussion Group
On Wednesday, February 10, 2016 at 1:45:33 AM UTC+1, Harry King wrote:
> lsuwest,
>
>
> You should have no difficulty in modelling a construction process. You can capture all the details that would normally go into a CPM or PERT analysis. Here are some suggestions to get you started:
> use a SimEntity to represent each of the sub-processes that you want to include in the modelgroups of workers, equipment, specialized trades, etc. should be modelled as separate Resourcesuse the Seize and Release objects to set the resource requirements during each stage of the sub-processes.use a separate TriangularDistribution for each task with an uncertain duration. This will allow you to specify the minimum, maximum, and most likely durations for the task in exactly the same way as a PERT analysis.use an EntityGate and one or more ExpressionThresholds to model any precedence relationshipsuse the StateAssignment keyword to set the state of each process as it works its way through the tasks in each process, and an EntityLogger to record the state times once the process is finished.use a SimEntity to represent the entire project and create the individual SimEntities for each sub-process using a Duplicate objectuse a Combine object to recombine the individual SimEntities for each sub-process to detect the end of the project.loop the project SimEntity back to the start of the model to initiate another pass through the project. This will allow you to execute the project thousands of times and obtain accurate statistics on the project duration, e.g. the minimum, maximum, and most likely values.
> Let me know how this works out for you. Your model would make a good demo if you are willing to share it.
>
>
> Harry

Dear Prof. Harry,

Thank you for these helpful tips. Actually, I am new JaamSim user, and there are some terminologies are not clear to apply and understand. Is there any link explain these terminologies?

All the best,
Ahmed Elkherbawy

Harry King

unread,
Sep 20, 2017, 6:20:02 PM9/20/17
to Jaamsim Users Discussion Group
Reply all
Reply to author
Forward
0 new messages