SimCore

class ontologysim.ProductionSimulation.sim.SimCore.SimCore

Bases: object

main class, connection point for all side classes

createEventList()

creates the event list onto

createLogger()

creates the short term logger onto and the normal logger

createOWLStructure()

owl classes, methods, attributes

createSimInstance()

creates sim instance in onto and sets time to 0

createWorld()

sync reasoning of owlready2

destroyOnto()

destroys the complete onto, important for restart

getCurrentTimestep()

get current time step in simulation

Returns:

float

main()

main method which is used while running simulation

prefixString = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n                    PREFIX owl: <http://www.w3.org/2002/07/owl#>\n                    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n                    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\n                    PREFIX ns: <http://test.org/onto.owl#>'
runNextEvent()

calculates next event and for every event type the necessaries steps are introduced

Returns:

[event_onto]

save_ontology(path='./ontologysim/example/owl/test.owl')

saves the ontology to owl-file

Parameters:

path

setCurrentTimeStep(time)

set new time step

Parameters:

time – float

setRandomSeedAddValue(value)

sets the random seed add value

Parameters:

value – int

set_save_time(save_time)

sets the time, where the ontology should be saved to owl

Parameters:

save_time – double

Central

class ontologysim.ProductionSimulation.sim.Central.Central(simCore)

Bases: object

storage location for classes and important instances from ontology, excluded from the simCore to make the simCore class smaller

extract_id_from_name(name)

every id starts with a string and ends with a number

Parameters:

name – name of onto

Returns:

id

fromIdGetType(id)

given a onto name, the type is extracted

Parameters:

id – str

Returns:

enum.name

getIds(type)

get all ids from type e.g. machine for accessing all Ids type==all

Parameters:

type – str

Returns:

dict{}

init_all_ids()

sets all ids from the different types, important when an owl-file is imported

init_class()

initialization of all ontology classes

init_instance()

initialization of important ontology instances to reduce the computing time: queue_list, queue_list_not_transport_and_end, task_list, all_prod_processes

Enum Labelling

class ontologysim.ProductionSimulation.sim.Enum.Defect_Type_Enum(value)

Bases: Enum

Enum for defect, defines the type of defect

Long = 'long'
Medium = 'medium'
Short = 'short'
class ontologysim.ProductionSimulation.sim.Enum.Evaluate_Enum(value)

Bases: Enum

Enum for evaluation, defines which onto category gets evaluated

Machine = 'Machine'
MachineDefect = 'EvMachineDefect'
OrderRelease = 'OrderRelease'
Product = 'Product'
ProductFinished = 'ProductFinished'
Transporter = 'Transporter'
TransporterDefect = 'EvTransporterDefect'
class ontologysim.ProductionSimulation.sim.Enum.Label(value)

Bases: Enum

is part of the id/name of the enum instance each onto name starts with one of these labels

CombineProcessData = 'combine_process_data'
DeadlockQueue = 'deadlock_q'
Defect = 'defect'
Distribution = 'd'
EndQueue = 'end_q'
Event = 'e'
EventList = 'e_l'
Location = 'l'
Logger = 'logger'
LoggerEvent = 'logger_e'
Machine = 'm'
MachineService = 'machine_service'
MachineServiceOperator = 'machine_service_operator'
NormalDistribution = 'normald'
Position = 'po'
Process = 'pr'
ProdProcess = 'ppr'
ProdTypeProcess = 'ptpr'
Product = 'p'
ProductType = 'p_t'
Queue = 'q'
RandomDistribution = 'randomd'
SetUp = 'setup'
ShortTermLogger = 'short_term_logger'
SimCore = 'sim_core'
StartQueue = 'start_q'
State = 'state'
SubDefect = 'sub_defect'
Task = 'task'
Transporter = 't'
TransporterService = 'transport_service'
TransporterServiceOperator = 'transport_service_operator'
class ontologysim.ProductionSimulation.sim.Enum.Machine_Enum(value)

Bases: Enum

Enum for Machine, defines the different states

Defect = 'MachineDefect'
Process = 'Process'
SetUp = 'SetUp'
Wait = 'Wait_Machine'
class ontologysim.ProductionSimulation.sim.Enum.OrderRelease_Enum(value)

Bases: Enum

Enum for order release, defines the states for order release

Release = 'Release'
class ontologysim.ProductionSimulation.sim.Enum.Product_Enum(value)

Bases: Enum

Enum for Product, defines the states of product

Defect = 'Defect'
EndBlockForTransporter = 'EndBlockForTransporter'
Process = 'Process'
Transport = 'Transport'
Wait = 'Wait'
class ontologysim.ProductionSimulation.sim.Enum.Queue_Enum(value)

Bases: Enum

Enum for Queue, defines the different change types

AddToTransporter = 'AddToTransporter'
Change = 'Change'
Default = 'Default'
EndProcess = 'EndProcess'
RemoveFromTransporter = 'RemoveFromTransporter'
RemoveFromTransporterDeadlock = 'RemoveFromTransporterDeadlock'
StartOfProduction = 'StartOfProduction'
StartProcess = 'StartProcess'
StartProcessStayBlocked = 'StartProcessStayBlocked'
class ontologysim.ProductionSimulation.sim.Enum.Transporter_Enum(value)

Bases: Enum

Enum for transporter, defines all states of transporter

Defect = 'TransporterDefect'
Transport = 'Transport'
Wait = 'Wait_Transport'

Task

class ontologysim.ProductionSimulation.sim.Task.Task(simCore)

Bases: object

handles the tasks in onto

createTask(product_type_onto, number_of_products, task_type='logging', start_time=0)

creates a new task in onto, tasks types: start, logging, end

Parameters:
  • product_type_onto – onto

  • number_of_products – number

  • task_type – str

transformToDict(id)

transform to dict :param id: string :return:

updateTaskList()

sets the task list in central class