© dream consortium embedding optimization with discrete event simulation anna rotondo paul young...
TRANSCRIPT
© DREAM Consortium
Embedding Optimization with Discrete Event Simulation
Anna Rotondo
Paul Young
John Geraghty
Dublin City University,
Dublin, Ireland
Georgios Dagkakis
Cathal Heavey
University of Limerick,
Limerick, Ireland
© DREAM Consortium
Potentials and limitations of hybrid simulation–optimization
Flexibility: Simulation can represent more real systems than mathematical methods (Banks 2000, Kelton and Law 2000)
Increasing academic interest: recently there have been many researchers producing methodologies for their combination (Figueira and Almada-Lobo 2014)
Software support: most Commercial-Off-The-Shelf (COTS) software provides modules for optimization (April and Glover 2003)
Computational overhead: it is expensive in time and resources to incorporate DES into optimization.
Complexity: it is not frequent that users of simulation tools are also experts in optimization algorithms (Lacksonen 2001).
Uncertainty: stochastic DES does not produce definitive results, but estimates, which makes it harder to be used within optimization algorithms (Banks, J., Carson, J. S., & Nelson 2000).
© DREAM Consortium
Different approaches in hybrid simulation–optimization
Describe a dual optimization architecture:i.simulation is used to evaluate different scenarios that an optimization pattern produces ii.additionally, algorithms are used inside the simulation model in order to address decisions.
Use an Open-Source (OS) Discrete Event Simulation (DES) engine (ManPy) which can incorporate these methodologies. Advantages:•Modularity•Flexibility/interconnectivity•No license cost
© DREAM Consortium
Proposed Architecture
© DREAM Consortium
DREAM Open Source modules
ManPy
DREAM GUIKE tool
Library of well-defined manufacturing objects that can be connected in a model
a browser-based user interface that allows the user to build, run a model and view the results
provides the means of interfacing with an organization’s data repositories. KE stands for “Knowledge Extraction”
© DREAM Consortium
DREAM platform modules
GUI
ManPy KE ToolJSON data model
DREAM Platform
DREAM code is open-source in https://github.com/nexedi/dream. A portal website is currently being built
© DREAM Consortium
ManPy – Manufacturing in Python
© DREAM Consortium
ManPy - Why Python?
Slower than executable languages
Python provides an intuitive syntax that makes it easier for modellers to write code.
Actively used in engineering being considered as a strong free alternative to MATLAB.
Many successful scientific libraries exist in Python. E.g. SciPy (check http://www.scipy.org/).
Characteristics that make it ideal for Discrete Event Simulation code such as:
Effective list processing Convenience in type-casting
© DREAM Consortium
Case study problem
• Medical device fabrication facility• The process is labour intensive; each station requires one or more Product Builders
(PBs)• A Team Leader (TL) is responsible of assigning PBs to machines• How to redistribute PBs to machines during a shift when a limited number of PBs is
available?
# of Machines >>> # of available PBs ?
© DREAM Consortium
Case study model
A simulation model of the line was developed using DREAM platform (Dagkakis et al 2014)
© DREAM Consortium
Case study model verification
Verification was conducted against COTS software and a dedicated SimPy model
(Dagkakis et al 2014)
Experimental Plan
ExtendSim model
Plant Simulation model DREAM model
SimPy model
Verification though comparison
© DREAM Consortium
Optimization within simulation: Assignment of PBs
multi-objective binary linear programming (LP) problem where the binary optimization variables consist of the assignment variables xij (i.e. operator i is assigned to machine j if xij is 1) and different objectives are taken into account:
1 Assign PBs to machines with highest WIP (Max WIP sum)
2Support uniform distribution of PBs across different stations(at least 1 PB per station (when station has 2 machines))
3 Avoid unnecessary PB transfers
4 Complete assignment to one sub-line before the other is filled
5 Prioritise assignment to machines that have been idle for longer time
6 Max number of assigned PBs
Objectives:
© DREAM Consortium
Objective Functions
1 Assign PBs to machines with highest WIP (Max WIP sum)
(operators)
(machines)
6 Max number of assigned PBs
© DREAM Consortium
Optimization within simulation: Assignment of PBs
The simulation model was set to call the LP algorithm in order to take decisions
Start Simulationt=0
t=T
t=2T
t=3T
EventGenerator: invokes allocation in given intervals
SkilledRouter: responsible to impose the allocation decision
LP Method: responsible to decide the allocation (Python
module external to ManPy)
© DREAM Consortium
Optimization within simulation: Assignment of PBs
The LP algorithm was coded using PuLP , a Python library that offers pre-defined methods to model a LP problem and generates LP or MPS files which can be solved by linear programming solvers, such as GLPK, COIN CLP/CBC and CPLEX (Mitchell 2009)LP solves the problem, but there are some issues:•Difficulty in the selections of weights for the objectives. Several sets of weights may lead the system being blocking•The solution is not dynamic, since the decision is taken based only with the current situation•The solution is not stochastic
For these reasons an external optimization module was added
© DREAM Consortium
Optimization using the simulation: Selection of the LP weights
An Ant Colony Optimization (ACO) algorithm was used in order to search models with different LP weights
ManPy Model
ACO
Set 1
Set 2
Set 3
Set N
Generate ant population assess ant
Adjust Selection Criteria
Replications
Ranking
Selection
…
LP Method
…
© DREAM Consortium
Optimization using the simulation: Selection of the LP weights
The potential values of weights are described in a Python dictionary{'1': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
'2': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
'3': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
'4': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
'5': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
'6': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]}
Every ant is created randomly selecting one of the possible weights. An ant is represented by a Python dictionary
AntX={'1': 0.2, '2': 0.3, '3': 1.0, '4': 0.7, '5': 0.3, '6': 0.8}
© DREAM Consortium
Optimization using the simulation: Selection of the LP weights
As the algorithm progresses it gives advantage to best performing weights. For example, if in the first generation the best performing ants are:
Then the potential weights for next generations would be updated to:
AntX={'1': 0.2, '2': 0.3, '3': 0.1, '4': 0.7, '5': 0.3, '6': 0.8}
AntY={'1': 0.4, '2': 0.2, '3': 0.1, '4': 0.6, '5': 0.1, '6': 0.8}
{'1': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 0.2, 0.4],
'2': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 0.3, 0.2],
'3': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 0.1, 0.1],
'4': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 0.7, 0.6],
'5': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 0.3, 0.1],
'6': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 0.8, 0.8]}
So the probability of selecting the weights of the best performing ants is increased
© DREAM Consortium
Optimization using the simulation: Selection of the LP weights
ACO is utilized in 2 DREAM pilot cases. Both classes inherit from the same plugin but are adapted to fulfil the specific attributes of the case. For example, in the other case the ACO search for the optimal scheduling rules in buffers of a job-shop system (Olaitan et al 2014), so the representation of an Ant is different.
•Potential for a future optimization layer in ManPy
JSACOJSACO
…
createCollatedScenario()
createAntData()
calculateAntScore()
ACOACO
run()
createCollatedScenario()
createAntData()
calculateAntScore()
BatchesACOBatchesACO
…
createCollatedScenario()
createAntData()
calculateAntScore()
Case Specific ACO plugins
Abstract ACO Plugin
ExecutionPluginExecutionPlugin
runOneScenario()
run()
Abstract Execution Plugin
© DREAM Consortium
Integration in DREAM GUI
User builds/edits the model in the GUI. For example:
Flow editor
Shifts for operators
© DREAM Consortium
Experiment
We tested the methodology in a deterministic actualization:•One shift of 9 hours
•WIP set from real historic data
•Processing times deterministic from company’s calculation sheets
• ACO weights:
• As KPI to rank the solutions throughput was used
• Ran the experiment for different numbers of generations and ants per generation
© DREAM Consortium
Results
Results from 50 generations with 4 ants per generation.
• Results of discrete nature; throughput takes the values 8, 9 and 12
• As ACO progresses the solutions with higher throughput get more frequent
• We see some logical pattern, e.g. ACO tends to minimize “Min assignment variations” weight. Logical since allowing flexing may lead to higher throughput
© DREAM Consortium
Results
Experimenting with different ACO setup:i.20 generations with 10 ants per generation;
ii.25 generations with 8 ants per generation.
iii.50 generations with 4 ants per generation.
• Better convergence when we allow ACO to move through more generations
• Experiments of 200 simulations needed 11-16 minutes in a 1.8 GHz Intel
Core i7 processor
© DREAM Consortium
Shifting to stochastic
•Experiments have been deterministic because that is how company uses their data.
•For the shake of experiment we used a rule to create triangular processing times:
• If processing time is deterministic with mean=a, then set it to triangular with min=0.8a, mean=a, max=1.2a
© DREAM Consortium
Stochastic Optimization – Approach 1
Ants produce a deterministic schedule. This is locked and then stochastically assessed for its robustness
Quite fast implementation. Replications do not use the LP which was found the most time consuming part of simulation
The Gantt schedule given to TL is assessed to be robust We do not optimize the weights in a stochastic manner, we just assess that
the deterministically produced schedule is robust
© DREAM Consortium
Stochastic Results – Approach 1
Below results from 5 ants we sampled. In the deterministic case they all produce a throughput of 12 batches. We ran them stochastically with, 20 replications each
We see that scenarios that perform similarly in the deterministic case differ significantly in the stochastic one. E.g:
•Ant3 performs much worse than the others
•Ant1 and Ant2 give the same average, but Ant2 has a narrower 95% confidence interval
Assignment to machines with higher WIP
Uniform assignment across stations
Min assignment variations
Fill sub-line
Machines with furthest last assignment time
Max number of assigned PB
Average Batch Throughput
95% LB Batch Throughput
95% RB Batch Throughput
Ant1 1.5 1.1 0 1.6 1 0.8 12.45 12.01 12.89Ant2 1.5 1.1 0 1.3 1.4 0.6 12.45 12.21 12.69Ant3 1.8 1.1 0 1.5 1 0.8 8.95 8.84 9.05Ant4 1.5 1.1 0 1.6 1.6 0.5 12.4 12.16 12.63Ant5 1.5 1.1 0 1.9 1 0.7 11.7 10.87 12.53
© DREAM Consortium
Stochastic Optimization – Approach 2
Ants are assessed stochastically to determine the optimal weights. These are stored and when TL wants to take a decision only the LP method with the optimal weights is run
We do optimize the LP weights Slow, but it can be run in the background Complex to setup in a real environment (Database and KE needed)
© DREAM Consortium
Cloud distribution of Simulation
• Parallel cloud distribution of the experiments has been prototyped using the the Simple Language for Accounting and Provisioning Operating System (SlapOS) (Smets-Solanes et al 2011)
• Implementation still in progress, so results are left for future work
© DREAM Consortium
Future work and challenges
Results confirm that the interface of simulation and optimization, which is the main research question of this study, is working.
However, there is still work to be conducted:•Experiments so far have been deterministic (see next slides)
•Ranking the solution only based on throughput may not be enough. It was observed that best performing solutions tend to allocate PBs near the end of the line, not leaving normalized WIP for next shifts. Given the discrete nature of results more KPIs could be considered
•Computational overhead in current implementation may be too high for stochastic cases
© DREAM Consortium
References
• April, J., F. Glover. 2003. Practical introduction to simulation optimization. Proceedings of the 2003 Winter Simulation Conference, vol. 1, 71–78.
• Banks, J., 2000. Introduction to simulation. Proceedings of the 2000 Winter Simulation Conference, vol 1, 9–16.
• Banks, J., J. S. Carson, B. L. Nelson. 2000. DM Nicol, Discrete-Event System Simulation. Prentice hall. Englewood Cliffs, NJ, USA.
• Can, B., A. Beham, C. Heavey. 2008. A comparative study of genetic algorithm components in simulation-based optimisation. Proceedings of the 40th Winter Simulation Conference.
• Dagkakis G., Rotondo A., Papagiannopoulos I., Heavy C., Geraghty J. and Young P. 2014. From COTS simulation software to an open-source platform : a use case in the medical device industry. In: Proceedings of the 8th International Conference on Digital Enterprise Technology (DET 2014).
• Figueira, G., B. Almada-Lobo. 2014. Hybrid simulation-optimization methods: A taxonomy and discussion. Simulation Modelling Practice and Theory 46 118–134.
© DREAM Consortium
References
• Kelton, W., Α. Law. 2000. Simulation modeling and analysis. McGraw-Hill. New York.
• Lacksonen, T. 2001. Empirical comparison of search algorithms for discrete event simulation. Computers & Industrial Engineering 40(1)133–148.
• Mitchell, S. 2009. An introduction to pulp for Python programmers. Python Papers Monograph, 1, 14.
• Olaitan, O., Geraghty, J., Young, P., Dagkakis, G., Heavey, C., Bayer, M., ... & Robin, S. (2014). Implementing ManPy, a Semantic-free Open-source Discrete Event Simulation Package, in a Job Shop. Procedia CIRP, 25, 253-260.
• Smets-Solanes, J. P., Cérin, C., & Courteaud, R. 2011. Slapos: A multi-purpose distributed cloud operating system based on an erp billing model. In Services Computing (SCC), 2011 IEEE International Conference on (pp. 765-766). IEEE.