Tools and Methods to Build Tasks

Overview of Tools and Methods

In general, there are two basic tools for creating tasks and assigning them to task executers:

  • Standard 3D Object Logic - Many of the 3D fixed resources have properties and basic logic that can be used to assign simple tasks to task executers, such as basic loading and unloading tasks or requiring an operator to be present during processing time. You usually need to connect task executers to fixed resources using port connections or a Dispatcher object in order to use standard logic.
  • Process Flow Shared Assets - You could also design task sequences in a process flow. You can use shared assets such as resources or lists to handle the allocation of task executers for particular tasks.

Each method has its own advantages and disadvantages, which will be discussed in more depth in this topic. You should also consider completing the Task Logic Tutorial 1 - Task Logic Tools if you would like an in-depth, hands-on guide to using the different tools and methods for building tasks.

Using Standard Logic to Create Tasks

Using standard logic means using port connections and the properties on 3D objects to create and assign tasks to task executers:

For example, the most basic task is to assign a task executer to transport flow items from one fixed resource to another. To create this logic:

  1. Connect the two fixed resources using input/output port connections (A-connects)
  2. Connect a task executer to the upstream fixed resource using a center portion connection (S-connect)
  3. Double-click the upstream fixed resource to open its properties window. On the Flow tab, check the Use Transport checkbox.
  4. In the box next to this checkbox, you'd indicate which task executer should do this task using the expression current.centerObjects[1].

The expression current.centerObjects[1] has three parts. The first part current means you will use something connected to the current 3D object (the object for which you are currently editing the properties). The second part centerObjects means you will use something that is connected through a center port. The last part [1] tells it to use the task executer that is connected through the first center port.

If you want to use more than one task executer in your simulation model, you usually have to connect them to a Dispatcher, which will handle allocating tasks to task executers based on their availability and/or other factors.

Using Resources in a Process Flow to Create Tasks

One method for creating tasks is to use resources, a kind of shared asset in a process flow:

In this kind of system, the tokens moving through the process flow usually represent tasks that need to be completed. The token then acquires a resource, which is linked to a task executer or group of task executers in the 3D model. The acquired task executer then completes the tasks and gets released after the tasks are complete.

Using Lists in a Process Flow to Create Tasks

Another method for creating tasks is to use lists, another kind of shared asset in a process flow:

In this kind of system, one set of tokens will move through the process flow and push tasks that need to be completed to a list. Then, you'll also have another set of tokens representing each task executer in the model. The tokens associated with the task executers will pull tasks off the list and then complete those tasks. After completing those tasks, the tokens representing the task executers can loop through the process flow and pull more tasks from the list.

Deciding on a Tool or Method

When you're in the planning stages of your simulation model and you're beginning to design the task logic, consider asking the following questions:

  • How will tasks be generated? For example, will a fixed resource generate tasks? Will a fixed resource push tasks to a list? Will an Event-Triggered Source in a process flow generate tasks?
  • How will tasks be assigned to task executers? Will certain tasks take priority over others? Will you need a way to assign tasks to task executers that uses something other than FIFO logic (first in, first out)?
  • Will some of the task details need to vary based on changing conditions in the simulation model? For example, will the destination of a load activity need to be dynamically determined at the time the task is assigned to a task executer?
  • Will task executers need to work together to complete a task? These are typically referred to as a coordinated tasks. See Coordinated Tasks for more information.
  • Will task executers sometimes need to be preempted away while they're working on tasks?
  • Will you need to create any custom tasks?

The method that you use to create and assign tasks in a simulation model will largely depend on the unique needs of your simulation project and your answer to some of these questions. If you plan on creating more complex task logic, you should probably consider using the Process Flow tool rather than standard 3D logic.

With that in mind, the following table provides an overview of the advantages and disadvantages of the different tools and methods for building tasks:

Method Advantages Disadvantages
Standard 3D Logic
  • Easy and quick set-up
  • Can assign task priorities
  • Can handle task preemption
  • Has difficulty handling custom or intermediate tasks
  • Can't always scale well as models grow in complexity
Resources in a Process Flow
  • Easy and quick set-up
  • Logic is more visible and easier to troubleshoot
  • Can easily handle custom or intermediate tasks
  • Easy to add or remove resources as needed
  • Has difficulty working in conjunction with standard logic
  • Can't assign task priorities or preempt task executers easily
  • Sometimes can't scale well if you will use a complex resource allocation strategy
Lists in a Process Flow
  • Can handle complex task assignment and priorities fairly well
  • Can sort or match tasks easily
  • Can be used in systems in which task executers look for work
  • Can easily work in conjunction with standard logic
  • Can generally scale well as the model grows in complexity
  • Not as easy or intuitive to set up
  • If you are using task sequences and pushing them to a global list, it might make it difficult to have dynamic decision making in the model

Just remember that it's never too late to switch to a different tool or method if you're finding one way isn't working for your simulation project. Once again, completing the Task Logic Tutorial 1 - Task Logic Tools could help you get a more in-depth feel for the different tools and methods for building tasks. Don't be afraid to experiment until you find the approach that works best for your simulation project.