The block allows a specified number of agents from several sources (5 or less) to be joined into a single agent. The type of the new agent, as well as its initialization, is specified by the user. The number of agents for each input required to produce one new agent is also specified using the block parameters (Quantity 1, Quantity 2, etc.). All arrived agents wait inside the block until all required agents arrive. Once the new agent can be built, the assembly operation starts. This operation takes the time specified in the Delay time parameter.
Assembly may involve resource usage — in this case you should specify what resource(s) are required to perform the assembly. For more detailed information on this topic, see Resources.
The new agent may be “completely new”, that is, a newly constructed agent whose properties possibly depend on the original agents, or it may be one of the original agents, again, possibly modified. If you want new agent to be exactly the same as the agent that arrived at the first input port, switch to the dynamic editor of the New agent parameter, and type there queue1.removeFirst().
Assembler may be used for a number of purposes. First, it can serve as a synchronization point to let one of the agents go further only after other ones arrive. Also this block can be used to combine different parts of a job.
In Assembler block agents may be disposed. However, the block does not know which of them will be disposed and doesn’t check if disposal is OK (that is, no resources, and so on). It is your responsibility to make sure the disposed agents are “clean”.
All agents that arrive into the block may be animated at the specified positions.
- Quantity 1, 2, …, 5
-
Number of agents required to arrive into in1, in2, …, in5 port to start producing a single new agent.
Syntax: int quantity1, quantity2, …, quantity5
-
The type of the agents exiting this block. Referred below as T.
Local variables: Queue queue1, queue2, …, queue5 — Assembler queues. You can access the agents stored there while generating new agent.
-
If the option is selected, i.e. the value is true, you will be able to change the dimensions of the agent created by this block specifying the new Length, Width and Height values below.
Value type: boolean
Local variable: T agent — the agent -
[Visible if the Change dimensions option is selected]
The new length of the assembled agent.Value type: double
Local variable: T agent — the agent -
[Visible if the Change dimensions option is selected]
The new width of the assembled agent.Value type: double
Local variable: T agent — the agent -
[Visible if the Change dimensions option is selected]
The new height of the assembled agent.Value type: double
Local variable: T agent — the agent - Seize resources
-
Here you can choose whether the assembly requires resource(s) of just one single resource type (units of the same pool), or resources of different types ((alternative) resource sets). For more details, see Resources.
Syntax: boolean seizeFromOnePool
-
[Visible if Seize resources is set to (alternative) resource sets option]
Here you define set(s) of resources required to perform the assembly. You can define several alternative resource sets (add new list by clicking the Add list button). The resource set is chosen based on the availability of resource units. For more details, see Resources.Local variable: T agent — the agent -
[Visible if Seize resources is set to units of the same pool option]
ResourcePool block defining the resources requested to perform the assembly. For more details, see Resources.Local variable: T agent — the agent. -
[Visible if Seize resources is set to units of the same pool option]
Expression evaluated to obtain the required number of resource units for the agent.Value type: int
Local variable: T agent — the agent -
Expression evaluated to obtain the delay time for the assembly operation.
Value type: double
Local variable: T agent — the current agent - Output buffer capacity
-
You can add a buffer where the assembled new agents (material items) can wait until the next block in the flowchart accepts them. For example, this might prove useful if the next block cannot accept the agents at the rate they are leaving the assembler block or if it requires the coordinates of the assembled agents. In this parameter you specify the maximum number of agents that can wait in this buffer. If you do not use the buffer (the value specified in this parameter is 0), the assembled agent will keep the seized resources (if any) and its animation will appear in the Location of assembled agent.
Syntax: int outputBufferCapacity
- Location of assembled agent
-
Defines the place where the new assembled agent will be placed. There are six alternative options:
Not specified — You do not specify the new location for assembled agents.
Network / GIS node — Assembled agents are placed in the given network node, GIS point, or GIS region.
Attractor — Assembled agents are placed in the specified attractor.
(x, y, z) — Assembled agents are placed in the point with the specified coordinates X, Y, Z.
(latitude, longitude) — Assembled agents are placed in the given point on the GIS map with the specified Latitude and Longitude.
Geographic place — Assembled agents are placed in the particular location on the GIS map. You define this place using the Name of place parameter below.Get value: locationType
Valid values: Assembler.LOCATION_NOT_SPECIFIED, Assembler.LOCATION_NODE, Assembler.LOCATION_ATTRACTOR, Assembler.LOCATION_XYZ, Assembler.LOCATION_LATLON, Assembler.LOCATION_GEO_PLACE -
[Visible if Location of assembled agent is set to Network / GIS node option]
Network node, GIS point, or GIS region where the agents created by this block are put.Local variable: T agent — the agent created at this block -
[Visible if Location of assembled agent is set to Attractor option]
Attractor where the agents created by this block are put.Value type: Attractor
Local variable: T agent — the agent created at this block -
[Visible if Location of assembled agent is set to (x, y, z) option]
X,Y,Z coordinates of the point where the agents created by this block will be put.Value type: double
Local variable: T agent — the agent created at this block -
[Visible and applies only if the Location of assembled agent option is set to (x, y, z) option]
Specifies where the new assembled agent will be added to upon exiting the assembler block: either Level or Network.Value type: boolean destinationInNetwork
Default value: false -
[Visible and applies only if the ...located in Level option is selected]
The level the agent will be added to once it exits the assembler block.Value type: Level
Local variables: T agent — the agent -
[Visible and applies only if the ...located in Network option is selected]
The network the agent will be added to once it exits the assembler block.Value type: INetwork
Local variables: T agent — the agent -
[Visible if Location of assembled agent is set to (latitude, longitude) option]
Latitude and longitude of the point on the GIS map where the assembled agents will be placed.Value type: double
Local variable: T agent — the agent -
[Visible if Location of assembled agent is set to Geographic place option]
The name of the particular location on the GIS map, where the assembled agents will get on generation. You specify the name as text put in quotes, e.g. "London". GIS map will search for a location with such name. The first location from the list of GIS search results will be used.Value type: String
Local variable: T agent — the agent -
[Visible if Location of assembled agent is specified]
The speed of the assembled agents.Value type: double
Default value: 10 m/s
Local variable: T agent — the agent - Agent location (delay)
-
Space markup shape (node or path) where the agents are located while being in the embedded Delay block.
Get value: entityLocationDelay
- Agent location (queue 1, .. , queue 5)
-
Space markup shape (node or path) where the agents are located while being in the embedded queue1, queue2, ... queue5 block.
Get value: entityLocationQueue1, entityLocationQueue2, ...
-
The priority of the task for the incoming agent (the larger the higher).
Value type: double
Default value: 0
Local variable: T agent — the agent -
If the option is selected, this task may preempt other tasks of the requested resource units.
Value type: boolean
Default value: true
Local variable: T agent — the agent -
Here you can choose what is done when a different task incomes for the resource unit(s) currently busy with the assembly operation.
No preemption — the current task continues executing.
Wait for original resource — the task is interrupted and waits for the same resource unit to finish it.
Terminate serving — the task is interrupted and never continued.
Seize any resource — the task is interrupted and tries to seize any resource of the specified type.
Continue without resource — the task is finished without resources assistance.Default value: No preemption
Valid values:
Assembler.PP_NO_PREEMPTION
Assembler.PP_WAIT_FOR_ORIGINAL_RESOURCE
Assembler.PP_TERMINATE_SERVING
Assembler.PP_SEIZE_ANY_RESOURCE
Assembler.PP_CONTINUE_WITHOUT_RESOURCE
Local variable: T agent — the agent - Auto suspend/resume agents
-
[Visible if Task preemption policy is set to Wait for original resource or Seize any resource option]
This parameter defines whether the agent whose task is suspended should be automatically suspended in its current flowchart block and automatically resumed at the time when the resources become available.Syntax: boolean suspendResumeEntities
Default value: true -
[Visible if Task preemption policy is set to Terminate serving option]
Enter block starting the flowchart branch for the agents which lost all obtained resource units because of Terminate serving preemption policy, when one of units in the resource set gets grabbed by another task with higher priority.Local variables:
T agent — the agent
Agent unit — the resource unit which has originated termination
- Customize resource choice
-
If the option is selected, you can choose some specific resource units for the operation (using the Resource choice condition below).
Syntax: boolean customizeResourceChoice
Default value: false -
[Visible if Customize resource choice is selected]
Here you can specify boolean expression that will be checked to find the specific resource unit(s) that may perform the operation. If none currently available resource unit(s) satisfy the specified condition (the condition returns false), the Assembler will wait for the first resource unit that matches the condition.
Usually you define some field inside the agent type (say, myAssistant), store there the reference to the resource unit when it starts working with this agent (agent.myAssistant=unit), and then specify here the condition agent.myAssistant==unit enabling only this particular unit to continue working with this particular agent.Value type: boolean
Default value: true
Local variables:
T agent — the agent
Agent unit — the resource unit
ResourcePool pool — the resource pool -
Here you can choose which resource units may be selected for the given agent.
Off (chooses some matching unit) — no special preference for the selection.
Nearest to the agent — the resource unit which is the closest to the current agent.br /> The most preferred — the resource unit is selected by comparing resources to each other. The comparison algorithm (or its call) is placed in the field "unit1 is preferred to unit2".br /> Unit with top rating — the resource unit with the highest rating is selected. The rating (or the algorithm that calculates it) is specified by the user in the Unit rating field.Default value: Off (chooses some matching unit)
Valid values:
Assembler.RESOURCE_SELECTION_SOME_UNIT
Assembler.RESOURCE_SELECTION_NEAREST
Assembler.RESOURCE_SELECTION_BASED_ON_COMPARISON
Assembler.RESOURCE_SELECTION_BASED_ON_RATING_VALUE
Local variables:
T agent — the agent
ResourcePool pool — the resource pool -
[Visible if Resource selection is set to The most preferred option]
The comparison algorithm (or its call) that is used for choosing a resource for the given agent. The algorithm compares resources to each other. It should return true if the resource unit1 has higher preference than the resource unit2 (and false otherwise, including the case of choice equality). The algorithm should provide transitiveness.Value type: boolean
Default value: false
Local variables:
Agent unit1 — the first resource to be compared
Agent unit2 — the second resource to be compared
T agent — the current agent -
[Visible if Resource selection is set to Unit with top rating option]
The rating value of this unit. The rating is used to choose a unit for the given agent (the larger the higher, unit with the top rating value will be chosen).
Usually an algorithm or a function call is placed here to calculate the rating with the help of the available local variables.Value type: double
Local variables:
T agent — the agent
Agent unit — the resource unit - Add combined agents to
-
Here you specify where the agents created by this block will be stored: in the default population of root agent, or in some custom population (specified below in the Population property).
Syntax: boolean addToCustomPopulation
Default value: default population(false) -
[Visible if Add combined agents to is set to custom population option]
The name of the agent population where the agents created by this block will be stored.Value type: AgentList
Local variable: T agent — the agent created by this block. - Force statistics collection
-
This block contains internal blocks that collect statistics. If the statistics collection is turned off for all Process Modeling Library blocks in the model by the PML Settings block, this option enables you to override this setting and collect the statistics for this specific block. Otherwise, the statistics will be collected regardless this setting.
Syntax: boolean forceStatisticsCollection
Default value: false
- On enter 1, 2, ..., 5
-
Code executed when an agent enters the block at in1, in2, …, in5.
Local variable: T1, T2, ... T5 agent — the agent
- On enter delay
-
Code executed when the agent enters the Delay.
Local variables: T agent — the agent
double delayTime — the delay time evaluated for the agent - On at exit
-
The callback executed when agent has finished its delay and ready to leave this block (if the subsequent block is not busy).
Local variable: T agent — the agent
- On exit
-
Code executed when the resulting agent exits the block.
Local variable: T agent — the resulting agent that will exit the block
- On task suspended
-
[Visible if Task preemption policy is set to Wait for original resource or Seize any resource option]
Callback for action executed when agent task is suspended because of Seize any resource and Wait for original resource preemption policy, when its unit gets grabbed by another task with higher priority.Local variables:
T agent — the agent
Agent unit — the unit - On task resumed
-
[Visible if Task preemption policy is set to Wait for original resource or Seize any resource option]
Callback for action executed when agent resumes processing after it has been suspended because of Seize any resource and Wait for original resource preemption policy.Local variables:
T agent — the agent
Agent unit — the resource unit - On task terminated
-
[Visible if Task preemption policy is set to Terminate serving option]
Callback for action executed when agent loses all units obtained in this Seize block because of Terminate serving preemption policy, when one of units in the resource set (defined in this Seize) gets grabbed by another task with higher priority.Local variables:
T agent — the agent
Agent unit — the resource unit which has originated termination
Function | Description |
---|---|
int queueSize(int n) | Returns the number of agents in the queue with the given number. |
Agent queueGet(int n, int index) | Returns the agent from the queue with a given index at the specified position (0 is at the exit). |
int delaySize() | Returns the number of agents in the embedded Delay block. |
T delayGet(int index) | Returns the agent at the index position in the Delay (the oldest agent is at the position 0). |
T remove(Agent agent) | Removes the given agent from the queue and returns it. If the agent is not contained in the queue, returns null. |
T resume(Agent agent) | Resumes previously suspended Delay (if was not suspended, throws error). |
T suspend(Agent agent) | Suspends this delay for the given timeout dt. |
double utilization() | Returns the mean utilization of this block. The returned value is the average (collected over time) of number of agents being serviced. |
boolean isStatisticsCollected() | Returns true if the block collects statistics. |
void recalculateResourceChoiceConditions(Agent agent) | Recalculates choice conditions for the given agent which is currently waiting in the queue of this block. You can use this function when some resource units that previously weren’t available for seizure by a particular agent may have become seizable due to changed conditions. |
void recalculateResourceChoiceConditions() | Recalculates choice conditions for all agents currently waiting in the queue of this block. You can use this function when some resource units that previously weren’t available for seizure may have become seizable due to changed conditions. |
- Queue queue1, queue2, queue3, queue4, queue5
- The internal queues.
- in1, in2, in3, in4, in5
- The input ports.
- out
- The output port.
-
How can we improve this article?
-