Location

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

Bases: object

python instance which handles the ontologysim location

calculateDistance(location_1, location_2)

airline calculation of distance between to onto locations

Parameters:
  • location_1 – onto

  • location_2 – onto

Returns:

double

createLocation(location_list)

create ontologysim location

Parameters:

location_list – [x,y,z]

Returns:

onto

init_distance_dict()

calculates for every location the distance to all other location, used for better performance

transformToDict(id)

saves onto location to dict

Parameters:

id – label from onto

Returns:

dict{x,y,z}

Queue

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

Bases: object

handles the onto queue

addPositions(queueInstance, number_of_positions)

adds position onto to queue, creates the positions

Parameters:
  • queueInstance – onto

  • number_of_positions – double

change(event_onto)

moves product form one position to another (betweent queues) when having only one machine queue, the current position gets blocked, when processing

Parameters:

event_onto – onto

createQueue(setting_dict, label, id=-1)

creates a queue in onto

Parameters:
  • setting_dict – {dict}

  • label – str (from enum no number)

  • id – int, number

Returns:

queue onto

create_change(part_onto, new_position_onto, time, event_type=Queue_Enum.Default)

creates event for changing position

Parameters:
  • part_onto – onto

  • new_position_onto – onto

  • time – double

  • event_type – Queue_Enum type

Returns:

double

create_change_for_start_queue(part_onto, new_position_onto, time, transportation_onto=None)

when starting a new production of a part, creating a change event

Parameters:
  • part_onto – onto

  • new_position_onto – onto

  • time – double

  • transportation_onto – onto

evaluateAddRemove(new_position_onto, oldPosition, event_onto)

currently the waiting time of machine is set to 10s, when now a part is removed or added to the machine queue, the waiting machine gets woken up

Parameters:
  • new_position_onto – onto

  • oldPosition – onto

  • event_onto – onto

get_free_positions(queue_onto)

get all not blocked positions, blockedSpace == 0

Parameters:

queue_onto – onto

Returns:

[position_onto]

get_number_of_free_positions(queue_onto)

number of not blocked positions, blockedSpace == 0

Parameters:

queue_onto – onto

Returns:

double

transformToDict(id)

transform the onto and the kpis into dict

Parameters:

id – str, label

Returns:

{}

Distribution

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

Bases: object

managing and creation of distribution onto

add_distribution_dict(distribution)

adding a distribution onto to the distribution dict

Parameters:

distribution – onto

Returns:

createDistribution(distribution_dict, onto_name)

creates distribution for ontologysim, currently only normal and random distribution possible

Parameters:
  • type – str

  • mean – for normal; min value for random

  • distribution – for normal; max value for random

Returns:

getRandomTimefromOnto(random_distribution_onto)

calculates value from distribution function

Parameters:

random_distribution_onto – onto

Returns:

time (float)

getSumTimefromOnto(distribution_onto)

calculates value from distribution function and adds current simulation time

Parameters:

distribution_onto – normal distribution onto

Returns:

time (float)

getTimefromLabel(distribution_label)

calculates value from distribution function

Parameters:

distribution_label – str

Returns:

time (float)

getTimefromOnto(distribution_onto)

calculates value from distribution function

Parameters:

distribution_onto – onto

Returns:

time (float)

ini_dict()

every distribution onto has it’s local RandomState, which is saved in the dict

Returns:

transformToDict(id)

transforms a onto-instance to dict

Parameters:

id – onto name

Returns:

dict{}

transform_name_to_int(name)

transforms a string to a number, each onto instance has it’s own defined distribution and random state

Parameters:

name – str

Returns:

int