Initializer

class ontologysim.ProductionSimulation.init.Initializer.Initializer(path_to_main_dir)

Bases: object

The intitializer is the main connection for the use from outside

important: all controller from the productionSimulation need to be imported at this position, alternatively you can create your own controller

addDataBaseToLogger(dataBase)

add database to logger :param dataBase: database object :return:

addDefect(sim_conf)

add defects to the ontology (optional)

Parameters:

defect_config_path

addDefectPathGiven(defect_config_path)

adding defect to simulationo, given file path :param defect_config_path: :return:

addLogger(log_conf)

add Logger to simulation :param log_config_path: Ini object

addLoggerAndDataBase(log_conf)

add logger and data base to simulation :param log_conf: Ini object :return:

addLoggerAndDataBasePathGiven(log_config_path)

adding logger and database to simulation given path file :param log_config_path: string :return:

addLoggerPathGiven(log_config_path)

add logger to similuation given path :param log_config_path: string :return:

addTask(sim_conf)

add tasks the ontologysim

Parameters:

production_config_path

addTaskPathGiven(sim_config_path)

adding task to simulation, given file path :param sim_config_path: :return:

createProduction(sim_config_path, owl_config_path)

initialize the simulation without tasks and defects creates the ontology calls the transformation of config files

Parameters:
  • sim_config_path

  • owl_config_path

initProductionComponents(sim_conf)

init simulation :param sim_conf: Ini object :return:

initSimCore()

creating the sim core class

loadController(contoller_conf)

loads all controller, which are necessary to run the simulation

Parameters:

path

loadControllerPathGiven(path)

load controller to simulation given path :param path: string :return:

loadProductionFromOWL(owl_path)

allowes to load a owl file to the simulation, depending on the owl-File it could be necessary to add tasks, defect

Parameters:

owl_path – .owl file

restart(production_config_path, owl_config_path, controller_config_path, logger_config_path, dataBase)

resets the complete simulation and starts a new one

Parameters:
  • production_config_path

  • owl_config_path

  • controller_config_path

  • logger_config_path

run()

starts the simulation run

run_until_first_event()

runs the simulation until the first event, mainly creates the ontolgy world

setFillLevel(fill_level)

defines the maximum number of products in the production in percentage

Parameters:

fill_level – percentage

setMachineController(python_class, controller_dict={})

adding a scheduling strategy for the machine is already included in load controller

Parameters:

python_class

setOrderReleaseController(python_class)

adding a order release strategy is already included in load controller

Parameters:

python_class

setServiceControllerMachine(python_class)

adding a defect handling strategy for the machine, only needed if defect is added is already included in load controller

Parameters:

python_class

setServiceControllerTransporter(python_class)

adding a defect handling strategy for the tranporter, only needed if defect is added is already included in load controller

Parameters:

python_class

setTransporterController(python_class, controller_dict={})

adding a routing strategy for the transporter is already included in load controller

Parameters:
  • python_class

  • controller_dict – dict

set_save_time(save_time)

the simulation only logs after x-seconds after the start of the simulation

Parameters:

save_time – float

test_production_config()

defines a short test if the owl and pnml files are set up correctly currently checked: - are all production ids defined - have the machines different location

transformProductionPath(sim_config_path)

transform ini input :param sim_config_path: path :return: Init object

Transform Logger ini

class ontologysim.ProductionSimulation.init.TransformLoggerIni.TransformLoggerIni(simCore)

Bases: object

there are multiple config structures available, currently lvl2 and lvl3 lvl1 is the most detailed, all config-files are getting converted to lvl1

transform_config_ini(type='lvl3', old_config_ini_dict={})

transforms the cofing input

Parameters:
  • type

  • old_config_ini_dict

Returns:

transform_ini(logger_ini={})

main method, which transform the config-file

Parameters:

production_ini

Returns:

transform_kpis(type='lvl3', old_kpi_ini_dict={})

transforms the kpis input

Parameters:
  • type

  • old_kpi_ini_dict

Returns:

transform_plot(type='lvl3', old_plot_ini_dict={})

transforms the plot input

Parameters:
  • type

  • old_plot_ini_dict

Returns:

transform_save(type='lvl3', old_plot_ini_dict={})

transforms the kpis input

Parameters:
  • type

  • old_plot_ini_dict

Returns:

Transform Production ini

class ontologysim.ProductionSimulation.init.TransformProductionIni.TransformProductionIni(simCore)

Bases: object

there are multiple config structures available, currently lvl2 and lvl1 lvl1 is the most detailed, all config-files are getting converted to lvl1

checkWaitingTimeMachine(machineList)

test if waiting time >0 :param machineList: list[{},…] :return:

checkWaitingTimeTransporter(old_transporter_ini_dict)

test if waiting time >0 :param old_transporter_ini_dict: dict :return:

transform_deadlock_queue(type='lvl2', old_deadlock_queue_ini_dict={}, default_value_config={})

transforms the deadlock queue input

Parameters:
  • type

  • old_deadlock_queue_ini_dict

Returns:

transform_defect(type='lvl2', old_defect_ini_dict={}, default_value_dict={})

transforms the defect input

Parameters:
  • type

  • old_defect_ini_dict

Returns:

transform_end_queue(type='lvl2', old_end_queue_ini_dict={}, default_value_config={})

transforms the end queue input

Parameters:
  • type

  • old_end_queue_ini_dict

Returns:

transform_ini(production_ini={})

main method, which transform the config-file

Parameters:

production_ini

Returns:

transform_machine(type='lvl2', old_machine_ini_dict={}, defaultValues={}, changeTime={})

transforms the machine input

Parameters:
  • type

  • old_machine_ini_dict

Returns:

transform_process(type='lvl2', old_process_ini_dict={})

transform the process input

Parameters:
  • type

  • old_process_ini_dict

Returns:

transform_product_type(type='lvl2', old_product_type_ini_dict={})

transforms the product type input

Parameters:
  • type

  • old_product_type_ini_dict

Returns:

transform_random_seed(type='lvl2', old_random_seed_ini_dict={})

transforms the random seed

Parameters:
  • type

  • old_random_seed_ini_dict

Returns:

transform_repair(type='lvl2', old_repair_ini_dict={})

transforms the repair input

Parameters:
  • type

  • old_repair_ini_dict

Returns:

transform_start_queue(type='lvl2', old_start_queue_ini_dict={}, default_value_config={})

transforms the start queue input

Parameters:
  • type

  • old_start_queue_ini_dict

Returns:

transform_task(type='lvl2', old_task_ini_dict={})

transforms the task input

Parameters:
  • type

  • old_task_ini_dict

Returns:

transform_transporter(type='lvl2', old_transporter_ini_dict={}, defaultValues={}, changeTime={})

transforms the transpoter input

Parameters:
  • type

  • old_transporter_ini_dict

Returns:

Petrinet generator

depriciated

ontologysim.ProductionSimulation.init.petrinet_generator.create_petrinet(product_type_id: int, product_paths: list, pnml_save_path: str, visualize=False)

creates a Petrinet out of a list possible productways through production given with a list of process_IDs e.g. products=[[‘0’,’1’,’2’],[‘0’,’1’]]

Deprecated since version 0.1.0: pm4py excluded

API: Initializer Producttype

class ontologysim.ProductionSimulation.init.API.IntitializerProducttypeAPI.InitializerProducttypeAPI

Bases: object

initialize all needed objects to create procudttype