This page describes advanced features of OptiFacility related to capacities (pickup and delivery of some products). Before reading this section, ensure you have read about the basic features of OptiFacility.
The following JSON file defines a problem instance with capacity constraints. Additions to the basic JSON file are highlighted:
{
"UserID": "demo",
"RequestID": 12348,
"Comment": "my first request with capacity constraints",
"Quality": 2,
"AgentSpeed": 45.0,
"AgentWorkTime": 8.0,
"AgentVisitTime": 1.0,
"CostAgentWork1h": 70.0,
"CostAgentTravel1km": 1.0,
"Products": 3,
"Facilities": [{"Lat":51.929, "Lon":18.614},
{"Lat":52.057, "Lon":19.176, "ChangeInProducts":[0,-7,0]},
{"Lat":51.989, "Lon":18.588, "ChangeInProducts":[10,0,0]},
{"Lat":51.864, "Lon":18.764, "ChangeInProducts":[-10,0,-15]},
{"Lat":51.89, "Lon":19.098, "ChangeInProducts":[-10,0,0]},
{"Lat":52.014, "Lon":18.889, "ChangeInProducts":[0,0,30]}],
"Agents":[{"Lat":51.768, "Lon":19.094, "CapacityForProducts":40}],
"Task": "FindRoutesCommutingIncluded"
}
The highlighted fields are specific to capacity constraints:
Products– a declaration of the number of different types of products that should be picked up/delivered.Facilities: ChangeInProducts– an array of integers that reflect the change in the agent's available product capacity that occurs when a facility is visited. Values in the array can be interpreted as the change in volume used up by products (of course, you can assume for simplicity that one product uses one unit of space). For example, an array of [-10, 25] will be interpreted as "visiting this facility takes 10 units of space of product #1, and gives back 25 units of space of product #2".The size of the array should match the value defined in the "Products" field. If "ChangeInProducts" is not defined for a facility, it is assumed that the array consists of all zeros.
Agents: CapacityForProducts– an integer defining the total capacity of an agent's vehicle.
No specific physical unit of space or volume is enforced, but obviously, the units used in the facility "ChangeInProducts" fields should match the units used in the agent "CapacityForProducts" fields.