Main > Reference Manual > Modeling > Operation
An operation represents an activity: these consume and produce material, take time and also require capacity.
An operation consumes and produces material, modeled through flows.
An operation requires capacity, modeled through loads.
Different operation types exist:
- operation_fixed_time:
Models an operation with a duration that is independent of the quantity. A good example is a transport or a procurement operation. - operation_time_per:
Models an operation where the duration increases linear with the quantity. A good example is a manufacturing operation where the duration is determined by the production rate of a machine. - operation_alternate:
Models a choice between different operations. - operation_routing:
Models a sequence a number of 'step' sub-operations, to be executed sequentially.
Fields
Field | Type | Description |
name | non-empty string |
Name of the operation. |
description | string |
Free format description. |
category | normalizedString |
Free format category. |
subcategory | normalizedString |
Free format subcategory. |
location | location |
Location of the operation. |
owner | operation |
Operations can be organized in a hierarchical tree. |
fence | duration |
Time window from the current date of the plan during which all operationplans are expected to be frozen / released. |
size_minimum | positive double |
A minimum quantity for operationplans. The default value is 1. |
size_multiple | positive double | A lotsize quantity for operationplans. |
size_maximum | positive double | The maximum quantity for operationplans. Note that this value limits the size of individual operationplans. The solver can create multiple operationplans of this maximum size, so this value does NOT constrain the total planned quantity on the operation. The field is useful to break big operationplans in smaller ones. |
cost | double |
The cost of executing this operation, per unit of the operation_plan. Depending on what the operation models, this represents transportation costs, manufacturing costs, material procurement costs, delivery costs, etc... |
pretime | duration |
A pre-operation time, used as a buffer for uncertain material supply. |
posttime | duration |
A post-operation time, used as a buffer for uncertain capacity or operation duration. This field is used to model time-based safety stock targets, aka days of inventory. It is then set for the producing operation of a certain buffer. |
detectproblems | boolean |
Set this field to false to skip problem detection on this operation. |
loads | list of load |
A list of all resources loaded by this operation. |
flows | list of flow |
A list of all buffers where material is consumed from or produced into. |
level | integer |
Indication of how upstream/downstream this entity is situated in the supply chain. |
cluster | integer |
The network of entities can be partitioned in completely independent parts. This field gives the index for the partition this entity belongs to. |
hidden | boolean |
Marks entities that are considered hidden and are normally not shown to the end user. |
action | A C AC (default) R |
Type of action to be executed:
|
operation_fixed_time
Models an operation with a fixed duration regardless of the quantity.
E.g. a transport operation.
This is the default operation type.
Field | Type | Description |
duration | duration |
Duration of the operation. |
operation_time_per
Models an operation where the duration changes linear with the quantity.
E.g. a production operation.
The total duration of the operation plan is the sum of:
- A fixed DURATION.
- A variable duration, computed as the operationplan quantity multiplied by a DURATION_PER.
Field | Type | Description |
duration | duration |
Fixed component of the duration of the operationplan. |
duration_per | duration |
Variable component of the duration of the operationplan. |
operation_alternate
Models a choice between different operations.
It has a list of alternate sub-operations listed, each with a priority.
Field | Type | Description |
search | string |
Defines the order of preference among the alternate operations.
|
alternates | List of alternate |
List of alternate sub-operations, each with their priority. |
Method | Description |
addAlternate( operation=[operation], priority=[number], effective_start=[date], effective_end=[date]) |
Add a new alternate sub operation. |
Alternate fields:
Field | Type | Description |
operation | operation | Sub-operation. |
priority | integer |
Priority of this alternate. |
effective_start | dateTime |
Earliest allowed start date for using this alternate. |
effective_end | dateTime |
Latest allowed end date for using this alternate. |
operation_routing
Models a sequence a number of 'step' sub-operations, to be executed sequentially.
Field | Type | Description |
steps | List of operation |
Lists all sub-operations in the order of execution. |
Method | Description |
addStep([operation],...) |
Add a new step sub operation to the routing. |
Example XML structures
- Adding or changing operations
<plan> <operations> <operation name="buy item X from supplier" xsi:type="operation_fixed_time"> <duration>P1D</duration> </operation> <operation name="make item X" xsi:type="operation_time_per"> <duration>PT1H</duration> <duration_per>PT5M</duration_per> </operation> <operation name="make or buy item X" xsi:type="operation_alternate"> <alternates> <alternate> <operation name="make item X" /> <priority>1</priority> </alternate> <alternate> <operation name="buy item X from supplier" /> <priority>2</priority> </alternate> </alternates> </operation> <operation name="make subassembly" xsi:type="operation_routing"> <steps> <operation name="make subassembly step 1" duration="PT1H"/> <operation name="make subassembly step 2" duration="PT5M"/> </steps> </operation> </operations> </plan>
- Deleting an operation
<plan> <operations> <operation name="make item X" action="R"/> </operations> </plan>
Example Python code
- Adding or changing operations
op1 = frepple.operation_fixed_time(name="buy item X from supplier", duration=24*3600) op2 = frepple.operation_time_per(name="make item X", duration=3600, duration_per=60*5) op3 = frepple.operation_alternate(name="make or buy item X") op3.addAlternate(operation=op1, priority=1) op3.addAlternate(operation=op2, priority=2, effective_end=datetime.datetime(2009,10,10)) op4 = frepple.operation_routing(name="make subassembly") op4.addStep( frepple.operation_fixed_time(name="make subassembly step 1" ,duration=3600), frepple.operation_fixed_time(name="make subassembly step 2" ,duration=300) )
- Deleting an operation
frepple.operation(name="make item X", action="R")
- Iterate over operations, loads and flows
for o in frepple.operations(): print "Operation:", o.name, o.description, o.category for l in o.loads: print " Load:", l.resource.name, l.quantity, l.effective_start, l.effective_end for l in o.flows: print " Flow:", l.buffer.name, l.quantity, l.effective_start, l.effective_end