Main > Reference Manual > Modeling > Resource
Resources represent capacity.
They represent a machine, a worker or a group of workers, or some logical limits.
A calendar refers to a time-phased maximum limit of the resource usage.
Operations will consume capacity using loads.
Different types of resources exist:
- resource_default:
A default resource is constrained with a maximum available capacity. - resource_infinite:
An infinite resource has no capacity limit.
Fields
Field | Type | Description |
name | non-empty string |
Name of the resource. |
description | string |
Free format description. |
category | normalizedString |
Free format category. |
subcategory | normalizedString |
Free format subcategory. |
owner | resource |
Resources can be organized in a hierarchical tree. |
members | list of resource |
Resources can be organized in a hierarchical tree. |
location | location |
Location of the resource. |
maximum | double |
Defines the maximum size of the resource. |
maximum_calendar | calendar |
Refers to a calendar storing the available capacity. Use this field when the resource capacity is varying over time. |
cost | double |
The cost of using 1 unit of this resource for 1 hour. |
detectproblems | boolean |
Set this field to false to suppress problem detection on this resource. |
maxearly | duration |
Time window before the ask date where we look for available capacity. |
loads | list of load |
Defines the capacity of the operations. |
loadplans | list of loadplan |
This field is populated during an export with the plan results for this resource. It shows the resource load profile. |
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. |
setup | non-empty string |
The name of the current setup of the resource, ie the setup of the resource at the start of the planning horizon. |
setupmatrix | non-empty string |
The name of the setup matrix which specifies the changeover times between setups. |
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:
|
resource_default
A default resource is constrained with a maximum available capacity.
No fields are defined in addition to the ones listed above.
resource_infinite
An infinite resource has no capacity limit.
It is useful to monitor the loading or usage.
The MAXIMUM field is unused for this resource type.
Example XML structures
- Adding or changing a resource
<plan> <resources> <resource name="machine X"> <maximum_calendar name="capacity calendar for machine X" /> </resource> <resource name="machine Y"> <maximum>2</maximum> </resource> </resources> </plan>
- Deleting a resource
<plan> <resources> <resource name="machine X" action="R"/> </resources> </plan>
Example Python code
- Adding or changing a resource
cal = frepple.calendar(name="capacity calendar for machine X") res_X = frepple.resource(name="machine X", maximum_calendar=cal) res_Y = frepple.resource(name="machine X", maximum=2)
- Deleting a resource
frepple.resource(name="machine X", action="R")
- Iterater over resources, loads and loadplans
for r in frepple.resources(): print "Resource:", r.name, r.description, r.category for l in r.loads: print " Load:", l.operation.name, l.quantity, l.effective_start, l.effective_end for l in r.loadplans: print " Loadplan:", l.operationplan.operation.name, l.quantity, l.startdate, l.enddate, l.operationplan.id