BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
Truck driver scheduling problem

Process TruckDriverProcess

Diagram

TruckDriverProcess

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:attributes>
<bpmnos:attribute id="Timestamp" name="timestamp" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="EarliestVisits" name="earliest_visits" type="collection">
</bpmnos:attribute>
<bpmnos:attribute id="LatestVisits" name="latest_visits" type="collection">
</bpmnos:attribute>
<bpmnos:attribute id="TravelTimes" name="travel_times" type="collection">
</bpmnos:attribute>
<bpmnos:attribute id="ServiceTimes" name="service_times" type="collection">
</bpmnos:attribute>
<bpmnos:attribute id="LastRest" name="last_rest := 0" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="LastBreak" name="last_break := 0" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="DrivingSinceRest" name="driving_since_rest := 0" type="decimal">
</bpmnos:attribute>
</bpmnos:attributes>
</bpmnos:status>
</bpmn2:extensionElements>

DataObject DataObject_1xt50y3

<bpmn2:extensionElements>
<bpmnos:attributes>
<bpmnos:attribute id="Instance" name="instance" type="string">
</bpmnos:attribute>
</bpmnos:attributes>
</bpmn2:extensionElements>

DataObject DataObject_09vd7xw

<bpmn2:extensionElements>
<bpmnos:attributes>
<bpmnos:attribute id="MaxDrivingSinceRest" name="max_driving_since_rest := 660" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="MaxElapsedSinceRest" name="max_elapsed_since_rest := 840" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="MaxElapsedSinceBreak" name="max_elapsed_since_break := 480" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="MinRestDuration" name="min_rest_duration := 600" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="MinBreakDuration" name="min_break_duration := 30" type="decimal">
</bpmnos:attribute>
</bpmnos:attributes>
</bpmn2:extensionElements>

SubProcess CustomerServiceActivity

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:attributes>
<bpmnos:attribute id="Index" name="index" type="integer">
</bpmnos:attribute>
<bpmnos:attribute id="ServiceTime" name="service_time := service_times[index]" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="TravelTime" name="travel_time := travel_times[index]" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="LatestVisit" name="latest_visit := latest_visits[index]" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="EarliestVisit" name="earliest_visit := earliest_visits[index]" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="DrivingTime" name="remaining_driving_time := travel_time" type="decimal">
</bpmnos:attribute>
</bpmnos:attributes>
</bpmnos:status>
<bpmnos:loopCharacteristics>
<bpmnos:parameter name="index" value="index">
</bpmnos:parameter>
<bpmnos:parameter name="cardinality" value="count( travel_times[] )">
</bpmnos:parameter>
</bpmnos:loopCharacteristics>
</bpmn2:extensionElements>

Task VisitTask

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:attributes>
<bpmnos:attribute id="Lateness" name="lateness := max(0,timestamp - latest_visit)" objective="minimize" type="decimal" weight="1">
</bpmnos:attribute>
</bpmnos:attributes>
<bpmnos:operators>
<bpmnos:operator expression="timestamp += service_time" id="Operator_3i531ul">
</bpmnos:operator>
</bpmnos:operators>
</bpmnos:status>
</bpmn2:extensionElements>

SubProcess WaitActivity

WaitActivity

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:attributes>
<bpmnos:attribute id="WaitDuration" name="duration" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="WaitType" name="wait_type" type="string">
</bpmnos:attribute>
</bpmnos:attributes>
</bpmnos:status>
</bpmn2:extensionElements>

Task BreakAtDestinationTask

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:operators>
<bpmnos:operator expression="timestamp += duration" id="Operator_2ih0qpu">
</bpmnos:operator>
<bpmnos:operator expression="last_break := timestamp" id="Operator_1v9kqtd">
</bpmnos:operator>
</bpmnos:operators>
</bpmnos:status>
</bpmn2:extensionElements>

Task RestAtDestinationTask

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:operators>
<bpmnos:operator expression="timestamp += duration" id="Operator_0tuoo7c">
</bpmnos:operator>
<bpmnos:operator expression="last_rest := timestamp" id="Operator_2vvafdb" type="assign">
</bpmnos:operator>
<bpmnos:operator expression="last_break := timestamp" id="Operator_1frp5g3">
</bpmnos:operator>
<bpmnos:operator expression="driving_since_rest := 0" id="Operator_0o9q9mr">
</bpmnos:operator>
</bpmnos:operators>
</bpmnos:status>
</bpmn2:extensionElements>

Task DecideAtDestinationTask

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:restrictions>
<bpmnos:restriction expression="( wait_type == "rest" ) || ( timestamp + min_rest_duration > earliest_visit)" id="Restriction_00240vk" scope="exit">
</bpmnos:restriction>
<bpmnos:restriction expression="( wait_type != "wait" ) || ( timestamp + min_break_duration > earliest_visit)" id="Restriction_27imf7e" scope="exit">
</bpmnos:restriction>
</bpmnos:restrictions>
<bpmnos:decisions>
<bpmnos:decision condition="wait_type in ["wait", "break", "rest"]" id="Decision_0udt1qg">
</bpmnos:decision>
</bpmnos:decisions>
</bpmnos:status>
</bpmn2:extensionElements>

SequenceFlow Flow_1at46ok

<bpmn2:extensionElements>
<bpmnos:restrictions>
<bpmnos:restriction expression="wait_type == "wait"" id="Restriction_Wait">
</bpmnos:restriction>
</bpmnos:restrictions>
</bpmn2:extensionElements>

SequenceFlow Flow_08rnlb8

<bpmn2:extensionElements>
<bpmnos:restrictions>
<bpmnos:restriction expression="wait_type == "break"" id="Restriction_Break">
</bpmnos:restriction>
</bpmnos:restrictions>
</bpmn2:extensionElements>

SequenceFlow Flow_08pr2zc

<bpmn2:extensionElements>
<bpmnos:restrictions>
<bpmnos:restriction expression="wait_type == "rest"" id="Restriction_Rest">
</bpmnos:restriction>
</bpmnos:restrictions>
</bpmn2:extensionElements>

Event TimerEvent

<bpmn2:extensionElements>
<bpmnos:timer>
<bpmnos:parameter name="trigger" value="earliest_visit">
</bpmnos:parameter>
</bpmnos:timer>
</bpmn2:extensionElements>

Task Activity_0ukjrfm

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:decisions>
<bpmnos:decision condition="max{ earliest_visit - timestamp, min_break_duration} <= duration <= max{ max{ earliest_visit - timestamp, min_break_duration}, latest_visit - timestamp}" id="Decision_1k9jgn5">
</bpmnos:decision>
</bpmnos:decisions>
</bpmnos:status>
</bpmn2:extensionElements>

Task Activity_0evasg5

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:decisions>
<bpmnos:decision condition="max{ earliest_visit - timestamp, min_rest_duration} <= duration <= max{ max{ earliest_visit - timestamp, min_rest_duration}, latest_visit - timestamp}" id="Decision_0cnh1uk">
</bpmnos:decision>
</bpmnos:decisions>
</bpmnos:status>
</bpmn2:extensionElements>

SequenceFlow Flow_12gilga

<bpmn2:extensionElements>
<bpmnos:restrictions>
<bpmnos:restriction expression="timestamp < earliest_visit" id="Restriction_1a83q9b">
</bpmnos:restriction>
</bpmnos:restrictions>
</bpmn2:extensionElements>

SequenceFlow Flow_14ovnm9

<bpmn2:extensionElements>
<bpmnos:restrictions>
<bpmnos:restriction expression="timestamp >= earliest_visit" id="Restriction_3lfp9vl">
</bpmnos:restriction>
</bpmnos:restrictions>
</bpmn2:extensionElements>

SubProcess TripActivity

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:attributes>
<bpmnos:attribute id="Loop" name="loop" type="boolean">
</bpmnos:attribute>
</bpmnos:attributes>
</bpmnos:status>
<bpmnos:loopCharacteristics>
<bpmnos:parameter name="condition" value="loop">
</bpmnos:parameter>
</bpmnos:loopCharacteristics>
</bpmn2:extensionElements>

Task DriveTask

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:attributes>
<bpmnos:attribute id="DriveDuration" name="duration := min( remaining_driving_time, max_driving_since_rest - driving_since_rest, max_elapsed_since_rest - (timestamp - last_rest ), max_elapsed_since_break - (timestamp - last_break) )" type="decimal">
</bpmnos:attribute>
</bpmnos:attributes>
<bpmnos:operators>
<bpmnos:operator expression="timestamp += duration" id="Operator_2lnpndi">
</bpmnos:operator>
<bpmnos:operator expression="driving_since_rest += duration" id="Operator_2b2lsd5">
</bpmnos:operator>
<bpmnos:operator expression="remaining_driving_time -= duration" id="Operator_1ub09t4">
</bpmnos:operator>
<bpmnos:operator expression="loop := (remaining_driving_time > 0)" id="Operator_2lf74hv">
</bpmnos:operator>
</bpmnos:operators>
</bpmnos:status>
</bpmn2:extensionElements>

SequenceFlow Flow_0s8gidz

<bpmn2:extensionElements>
<bpmnos:restrictions>
<bpmnos:restriction expression="remaining_driving_time > 0" id="Restriction_09erveo">
</bpmnos:restriction>
</bpmnos:restrictions>
</bpmn2:extensionElements>

SequenceFlow Flow_09sie24

<bpmn2:extensionElements>
<bpmnos:restrictions>
<bpmnos:restriction expression="remaining_driving_time == 0" id="Restriction_2dkcu1c">
</bpmnos:restriction>
</bpmnos:restrictions>
</bpmn2:extensionElements>

SubProcess OffDutyActivity

OffDutyActivity

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:attributes>
<bpmnos:attribute id="OffDutyDuration" name="duration" type="decimal">
</bpmnos:attribute>
<bpmnos:attribute id="OffDutyType" name="offduty_type" type="string">
</bpmnos:attribute>
</bpmnos:attributes>
</bpmnos:status>
</bpmn2:extensionElements>

Task DecideDuringTripTask

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:restrictions>
<bpmnos:restriction expression="( offduty_type == "rest" ) || ( (driving_since_rest < max_driving_since_rest) && ( timestamp + min_break_duration < last_rest + max_elapsed_since_rest ) )" id="Restriction_3ngmssf" scope="exit">
</bpmnos:restriction>
</bpmnos:restrictions>
<bpmnos:decisions>
<bpmnos:decision condition="offduty_type in ["break","rest"]" id="Decision_2hfddnu">
</bpmnos:decision>
</bpmnos:decisions>
</bpmnos:status>
</bpmn2:extensionElements>

SequenceFlow Flow_00x8mrp

<bpmn2:extensionElements>
<bpmnos:restrictions>
<bpmnos:restriction expression="offduty_type == "break"" id="Restriction_BreakOnTrip">
</bpmnos:restriction>
</bpmnos:restrictions>
</bpmn2:extensionElements>

SequenceFlow Flow_16bmg1w

<bpmn2:extensionElements>
<bpmnos:restrictions>
<bpmnos:restriction expression="offduty_type == "rest"" id="Restriction_RestOnTrip">
</bpmnos:restriction>
</bpmnos:restrictions>
</bpmn2:extensionElements>

Task BreakDuringTripTask

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:operators>
<bpmnos:operator expression="timestamp += duration" id="Operator_3midv9s">
</bpmnos:operator>
<bpmnos:operator expression="last_break := timestamp" id="Operator_2g12etq">
</bpmnos:operator>
</bpmnos:operators>
</bpmnos:status>
</bpmn2:extensionElements>

Task RestDuringTripTask

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:operators>
<bpmnos:operator expression="timestamp += duration" id="Operator_3fkas66">
</bpmnos:operator>
<bpmnos:operator expression="last_rest := timestamp" id="Operator_0d2otbv">
</bpmnos:operator>
<bpmnos:operator expression="last_break := timestamp" id="Operator_3fj94i1">
</bpmnos:operator>
<bpmnos:operator expression="driving_since_rest := 0" id="Operator_3ur69m9">
</bpmnos:operator>
</bpmnos:operators>
</bpmnos:status>
</bpmn2:extensionElements>

Task Activity_0r4ynpt

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:decisions>
<bpmnos:decision condition="min_break_duration <= duration <= max{ min_break_duration,latest_visit - remaining_driving_time - timestamp}" id="Decision_02uohv2">
</bpmnos:decision>
</bpmnos:decisions>
</bpmnos:status>
</bpmn2:extensionElements>

Task Activity_1yum9rm

<bpmn2:extensionElements>
<bpmnos:status>
<bpmnos:decisions>
<bpmnos:decision condition="min_rest_duration <= duration <= max{ min_rest_duration,latest_visit - remaining_driving_time - timestamp}" id="Decision_0395q7p">
</bpmnos:decision>
</bpmnos:decisions>
</bpmnos:status>
</bpmn2:extensionElements>