Objective functions and system optimisation

Discrete Event Simulation in Python

Diogo Costa (PhD, MSc)

Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific

System optimization

  • System optimization

    • Identifying optimal operational configuration
  • Human-driven processes

    • Maximum output with least costs (fewer resources, less time)
  • Identifying processes with higher impact on system output

  • Monte-Carlo sampling

    • Measure success and rank results
  • Objective functions

    • Target function to sets performance goals
Discrete Event Simulation in Python

Objective function

  • Math expression describing output target

  • Score simulation scenarios

Example

  • Process A: 35%
  • Process B: 20%
  • Process C: 45%

Total: 100%

  • Process C has highest weight

Search & Stop: Run different model configurations and stop when desired condition is met

while total_duration < 24:
      model_to_run()

Score & Rank: Score simulation results based on weighing criteria

for i in range(num_runs):
   out_1, out_2 = model_to_run(i)
   scores(i) = 0.3 * out_1 + 0.7 * out_2
Discrete Event Simulation in Python

Approach 1: Search & Stop

  • Monte Carlo sampling to run multiple scenarios
  • Consists of different non-deterministic processes occurrences
  • Optimal scenario search loop is interrupted when condition is meet

Example

scenario_num = 0
while scenario_num == 0 or total_duration[s] > 40:
  scenario_num += 1
  env = simpy.Environment()
  env.process(manufractoring_proc(env))
  env.run()
  plot_results()

Plot showing the response envelope of a manufacturing activity that includes a series of sequential processes, where the blue bottom line corresponds to the last run that met the requirements of the Search & Stop method.

Discrete Event Simulation in Python

Approach 2: Score & Rank

  • Monte Carlo sampling to run multiple scenarios
  • Score and rank results

Example: Manufacturing industry

Involving various sequential tasks (or processes), such as a car production line.

def objective_function_calc():
  score_objfunc = np.ones(num_scenarios)

  for s in range(num_scenarios):
    for p in range(len(processes)):

      score_objfunc[s] += 
         processes[p]["duration_hours"]
         * processes[p]["score_weight"]
Discrete Event Simulation in Python

Approach 2: Score & Rank

Score

"RED": Low score; "BLUE": High score Scatter plot showing the objective function score of the various scenarios simulated for the processes "Unloading and Preparing, "Cutting" and "Polishing".

Rank

Score-ranking simulation runs Plot ranking the scenarios according to the objective function score of the various scenarios simulated for the processes "Unloading and Preparing, "Cutting", and "Polishing".

Discrete Event Simulation in Python

Identifying critical processes that limit performance

Search & stop

Plot showing the response envelope of a manufacturing activity that includes a series of sequential processes, where the blue bottom line corresponds to the last run that met the requirements of the Search & Stop method. The minimum duration of each of the processes obtained for the best simulations is highlighted.

  • "Blue" line met the "stop" criteria

    • Total duration = 30 min
  • Breakdown results of "best" simulation:

    • Process 1: about 10 min (sum = 20 min)
    • Process 2: about 10 min (sum = 20 min)
    • Process 3: about 8 min (sum = 28 min)
    • Process 4: about 2 min (sum = 30 min)
  • "Process 1" critical to achieve this goal

Discrete Event Simulation in Python

Identifying critical processes that limit performance

Score

Objective: lowest score = lowest duration Scatter plot showing the objective function score of the various scenarios simulated for the processes "Unloading and Preparing, "Cutting" and "Polishing". The minimum duration of each of the processes obtained for the best simulations is highlighted.

Rank

"Process 1" critical to achieve this goal Plot ranking the scenarios according to the objective function score of the various scenarios simulated for the processes "Unloading and Preparing, "Cutting", and "Polishing". The minimum duration of each of the processes obtained for the best simulations is highlighted.

Discrete Event Simulation in Python

Let's practice!

Discrete Event Simulation in Python

Preparing Video For Download...