example_simio.py

 1"""
 2Created on 27 Jun 2019
 3
 4@author: jhkwakkel
 5"""
 6
 7from ema_workbench import ema_logging, CategoricalParameter, MultiprocessingEvaluator, ScalarOutcome
 8
 9from ema_workbench.connectors.simio_connector import SimioModel
10
11if __name__ == "__main__":
12    ema_logging.log_to_stderr(ema_logging.INFO)
13
14    model = SimioModel(
15        "simioDemo", wd="./model_bahareh", model_file="SupplyChainV3.spfx", main_model="Model"
16    )
17
18    model.uncertainties = [
19        CategoricalParameter("DemandDistributionParameter", (20, 30, 40, 50, 60)),
20        CategoricalParameter("DemandInterarrivalTime", (0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2)),
21    ]
22
23    model.levers = [
24        CategoricalParameter("InitialInventory", (500, 600, 700, 800, 900)),
25        CategoricalParameter("ReorderPoint", (100, 200, 300, 400, 500)),
26        CategoricalParameter("OrderUpToQuantity", (500, 600, 700, 800, 900)),
27        CategoricalParameter("ReviewPeriod", (3, 4, 5, 6, 7)),
28    ]
29
30    model.outcomes = [ScalarOutcome("AverageInventory"), ScalarOutcome("AverageServiceLevel")]
31
32    n_scenarios = 10
33    n_policies = 2
34
35    with MultiprocessingEvaluator(model) as evaluator:
36        results = evaluator.perform_experiments(n_scenarios, n_policies)