systems design for scheduling: open tools patrick de causmaecker, peter demeester, greet vanden...
TRANSCRIPT
Systems design for scheduling: Open Tools
Patrick De Causmaecker, Peter Demeester, Greet Vanden Berghe and
Bart Verbeke
KaHo Sint-Lieven, Gent, Belgium
http://ingenieur.kahosl.be/projecten/dingo
Vakgroep IT KaHo Sint-Lieven 2
Overview
Introduction: distributed personnel scheduling Local optimisation Agent model Web service Conclusion
Vakgroep IT KaHo Sint-Lieven 3
Introduction: problem description Most companies have different departments When departments > critical size => isolated islands
Almost no communication with other departments Keep department information private
This leads to sub optimal behaviour Oversimplified example:
Hospital consisting of different departments One department is understaffed due to illness, holidays,… Some are overstaffed Exchange of nurses solves both their problems
Vakgroep IT KaHo Sint-Lieven 4
Introduction: problem description
Sub optimality is solved at the moment: negotiations between different heads of
department Time consuming activity
Goal of this research: Automating this negotiation
Vakgroep IT KaHo Sint-Lieven 5
Final solution
Negotiation
Department 1
Tabu Search
1st local solution
Department 2
Tabu Search
1st local solution
Department 3
Tabu Search
1st local solution
Final solution
Final solution
Initial assignment of personnel
Our approach
Vakgroep IT KaHo Sint-Lieven 6
Local optimisation Since we are developing a general tool applicable
in different domains/sectors: Need of general evaluation method that can evaluate
different constraints => Numbering evaluation method1
Evaluation mechanism implemented in Java Constraints are expressed in XML
1 E.K. Burke, P. De Causmaecker, S. Petrovic, G. Vanden Berghe: Fitness Evaluation for Nurse Scheduling Problems, Proceedings of Congress on Evolutionary Computation, CEC2001, Seoul, IEEE Press, 2001, p. 1139-1146.
Vakgroep IT KaHo Sint-Lieven 7
Numbering: example Planning period: 1 week
soft constraints: Maximum number of assignments 6 Minimum 2 Maximum number consecutive free days 8 Minimum 2 Maximum number consecutive assignments 4 Minimum 2 Maximum number of shifts per day 1 Maximum number of night shifts 3 Minimum number consecutive night shifts 2 Work full weekends
from until M Morning shift 06:45 14:45 L Late shift 14:30 22:00 N Night shift 22:00 07:00
N1
N2
N3
Vakgroep IT KaHo Sint-Lieven 8
Numbering: example
* * * * * N1 0 0 0 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 N2 U U 0 U U 1 U U 2 U U 3 U U 4 U U 5 U U 6 N3 U U U U U U U U U U U U U U U 0 0 0 1 1 1
roster P1
constraints N1
max-total = 6
min-total = 2
max-between = 8
min-between = 2
max-consecutive = 4
min-consecutive = 2
max-pert = 1
counters
last
total
consecutive
constant
max
constraints N2
max-total = 3
min-consecutive = 2
constraints N3
min-consecutive = 2
Mon Tue Wed Thu Fri Sat Sun P1 M M L L N
Vakgroep IT KaHo Sint-Lieven 9
Evaluation algorithm Initialisation: taking into account the previous planning
map numberings onto the previous planning period search values for counters: initialise
Intermediate evaluation: adjust counters and calculate costs if necessary
Final evaluation: calculate costs at the end of the planning period
per iteration the algorithm is executed 1 x per person in the planning independently of the number and the type of soft constraints
Vakgroep IT KaHo Sint-Lieven 10
Constraints N1 in XML<constraint ID="1">
<numberingId>1</numberingId><variables>
<max_total weight="1">6</max_total><min_total weight="1">2</min_total><max_pert weight="1">1</max_pert><min_pert weight="1">-infinity</min_pert><max_between weight="1">8</max_between><min_between weight="1">2</min_between><max_consecutive weight="1">4</max_consecutive><min_consecutive weight="1">2</min_consecutive>
</variables></constraint>…
Vakgroep IT KaHo Sint-Lieven 11
<day ID="4"><shift ID="1">3</shift><shift ID="2">3</shift><shift ID="3">3</shift>
</day><day ID="5">
<shift ID="1">4</shift><shift ID="2">4</shift><shift ID="3">4</shift>
</day><day ID="6">
<shift ID="1">5</shift><shift ID="2">5</shift><shift ID="3">5</shift>
</day><day ID="7">
<shift ID="1">6</shift><shift ID="2">6</shift><shift ID="3">6</shift>
</day></numbering>…
Constraints N1 in XML…<numbering ID="1">
<day ID="1"><shift ID="1">0</shift><shift ID="2">0</shift><shift ID="3">0</shift>
</day><day ID="2">
<shift ID="1">1</shift><shift ID="2">1</shift><shift ID="3">1</shift>
</day><day ID="3">
<shift ID="1">2</shift><shift ID="2">2</shift><shift ID="3">2</shift>
</day>
Vakgroep IT KaHo Sint-Lieven 12
Evaluation algorithm
Every constraint that can be expressed in the proposed XML format can be evaluated!
Local search algorithm: tabu search Use OpenTS Framework for implementation http://www.coin-or.org/OpenTS/
Vakgroep IT KaHo Sint-Lieven 13
Non-distributed case
Local searchcomponent
WebserviceDepartment
webservice
Vakgroep IT KaHo Sint-Lieven 14
Webservice
To guarantee openness: we provide a webservice that allows communication with the evaluation component
Webservice: implemented in Apache SOAP (http://ws.apache.org/soap/)
As a proof of concept: We developed a GUI that uses webservice to
generate solutions
Vakgroep IT KaHo Sint-Lieven 15
Agents
Final solution
Negotiation
Task 1
Tabu Search
1st local solution
Task 2
Tabu Search
1st local solution
Task 3
Tabu Search
1st local solution
Final solution
Final solution
Initial assignment of personnel
Vakgroep IT KaHo Sint-Lieven 16
Agent model Every department is represented by an agent Every member of personnel is represented by an
agent Note:
agents are not used in local search algorithm However they are used to (improve) negotiate about the
solution
Question: how organise the exchange of personnel among the departments?
Need of a coordination model
Vakgroep IT KaHo Sint-Lieven 17
Coordination model
Contract Net Protocol
Announce a task
manager
contractors
Submit a bid
manager
contractors
manager
contractors
Grant contract
Vakgroep IT KaHo Sint-Lieven 18
Agent Architecture (CNP)OmbudsAgent
DepartmentAgent
Moz
art/
Oz
Java
DepartmentAgent
DepartmentAgent
DepartmentAgent
Local search algorithm
XM
L-R
PC
Vakgroep IT KaHo Sint-Lieven 19
Agent Architecture ( CNP)DepartmentAgent
Moz
art/
Oz
Java
XM
L-R
PC
EmployeeAgent
EmployeeAgent
Local search algorithm
Vakgroep IT KaHo Sint-Lieven 20
Coordination Model
Blackboard: Demand/supply for personnel are written on a
black board Token Ring:
there is no boss, every department can ask a question per round
Vakgroep IT KaHo Sint-Lieven 21
Department 1Department 2
Department 3Department 4
Negotiationserver
Distributed case
Local searchcomponent
Webservice
evaluationcomponent
Local searchcomponent
Webservice
evaluationcomponent
Local searchcomponent
Webservice
evaluationcomponent
Local searchcomponent
Webservice
evaluationcomponent
Vakgroep IT KaHo Sint-Lieven 22
Communication Local search algorithm implemented in Java Agent negotiation mechanism implemented in
Mozart/Oz Communication:
Socket? Webservice?
Opt to use webservice: SOAP? Alternative: XML-RPC?
Vakgroep IT KaHo Sint-Lieven 23
Conclusion Platform independent implementation of
personnel planning application that is useful for many domains
Open: Every constraint that can be expressed in
proposed XML format can be evaluated Methods can be called via web service
Tools will be available for download in November 2005 from http://ingenieur.kahosl.be/projecten/DINGO/
Vakgroep IT KaHo Sint-Lieven 24
Questions?
Thank you for your attention!
Vakgroep IT KaHo Sint-Lieven 25
M L N
Solution structure
Example0|1|0||1|0|0||0|0|0||0|0|1||0|1|0||0|0|1||1|0|0|
0|0|1||1|0|0||1|0|0||1|0|0||0|0|1||0|1|0||0|0|1|
1|0|0||1|0|0||1|0|0||0|0|0||1|0|0||0|0|0||0|1|0|
1|0|0||1|0|0||0|0|0||1|0|0||0|0|0||0|1|0||0|1|0|
0|1|0||0|1|0||0|1|0||1|0|0||1|0|0||0|1|0||0|1|0|
1|0|0||0|0|0||0|0|0||0|1|0||1|0|0||0|1|0||1|0|0|
Vakgroep IT KaHo Sint-Lieven 26
Moves
Flip move: 0 => 1 or 1 => 0 Swap move: swap 2 elements Row and column swap move
Vakgroep IT KaHo Sint-Lieven 27
Ombuds Agent Department Agenti
CFP Every one sends most expensive cost + time
slot. Result of local search algorithm
(Cost, T)i
Evaluate every proposed change and
generate corresponding cost
ACCEPT PROPOSAL
REJECT PROPOSAL
Involved Department Agents exchange
personnel and adapt department timetable
for that shift
CNP
CFP
(Cost, T)i
Only these agents that have done changes
send their costs
CNP
Employee Agentj
send timetable to every personnel
member
CFP: Qmax, Tmax
Cost
ACCEPT PROPOSAL
Every involved agent evaluates
its own constraints and
generates a cost
REJECT PROPOSAL
Take highest cost
Send others a REJECT
Costi
ACCEPT PROPOSAL
REJECT PROPOSAL
CFP: Qmax, Tmax
CNP
If Costi < threshold, then change is
accepted
Otherwise not
Sends agents that have done changes
a new CFP