Logger
- class ontologysim.ProductionSimulation.logger.Logger.Logger(simCore)
Bases:
object
main class for the kpi logger, all information or inputs are handled by the logger, the subloggers are then responsible for evaluating and calculating the kpis
- addIni(path)
copying the ini folder with all the configs to the log folder
- Parameters:
path –
- commitDB()
commit DB, add cache to database :return:
- createPath()
create new folder and save all_events :return:
- create_output()
main class for saving the information, calls the sub logger
- Returns:
- evaluatedInformations(dict_list)
main class for the logger, interface for the simulation calsses to log some informations
- Parameters:
dict_list – [dict{},..]
- Returns:
- finale_evaluate(time)
when logging is finished, a finale logging have to be done
- Parameters:
time –
- getLoggerType(enum_value, summary_list, time_list)
define logger type, if summary and or time or nothing :param enum_value: :param summary_list: :param time_list: :return: string
- initLogger(log_conf)
initialise the logger and defines what to log
- Parameters:
logger_config_path – dict
- Returns:
- saveInformation()
save simulationfact in database after simulation run :return:
- setDataBase(dataBase)
add database :param dataBase: database object :return:
- setStartLogger(time)
sets the start of the logging
- Parameters:
time – double
Sub logger
- class ontologysim.ProductionSimulation.logger.SubLogger.SubLogger(logger)
Bases:
object
parent class for all kpi loggers, task: saving, calculation and handling of kpis
- addElement(dict_element)
interface to the logger, all data from the simulation are provided through this class
- Parameters:
dict_element – {‘type’,’time_diff’,’event_onto_time’,……………}
- addNewTimeElement(object_list, kpi_list, time)
inserting a new time element (time intervall)
- Parameters:
object_list – [label list]
kpi_list – [kpi name]
time – double
- addTimeElement(object_name, kpi_key_list, time, time_diff)
adds a new value to the time element (time intervall)
- Parameters:
object_name – label
kpi_key_list – [KPI’s name]
time – double
time_diff – double
- Returns:
- addTimeSumElement(object_name, kpi_key_list, time, time_diff)
used when adding a number and not a time
- Parameters:
object_name – label
kpi_key_list – [kpi name]
time – double
time_diff – double
- Returns:
- checkStartTimeLogging(dict_element)
checks if the event has taken place before the starting time
- Parameters:
dict_element – {‘type’,’time_diff’,’event_onto_time’,……………}
- Returns:
dict element
- finale_evaluate(time)
when the logging ends, a last evaluation must be calculated
- Parameters:
time –
- Returns:
- getSummaryList()
transfrom dict of summary kpi data to list :return:
- getSummaryListAPI(summarized_data)
transfrom dict of summary kpi data to list :param summarized_data: :return:
- getTimeList(object_key)
get time list for object key :param object_key: string :return:
- initSubLogger(dict_element)
initializing of sub_logger
- Parameters:
dict_element – information from config
- isNotLogging()
check if nothing is logged :return:
- isSummaryLogging()
check if summary data is logged :return:
- isTimeLogging()
chek if time data is logged :return:
- save(path, folder_name, summarized_name)
method which handles the saving of information to csv or database
- Parameters:
path –
folder_name –
summarized_name –
- Returns:
- save_to_csv(path, folder_name, summarized_name)
saves the time and summarized kpi’s, for the time kpi’s there is an extra folger created
- Parameters:
path – str
folder_name – str
summarized_name – str
- Returns:
- save_to_database()
save to database, abstract method :return:
- split_time(time, time_diff)
split the the given time into the different time intervalls
- Parameters:
time –
time_diff –
- Returns:
{‘start_time’, ‘end_time’:, ‘time_diff’}
- test_object_name_all()
test method which checks, if the objects calculated together are the equal to the all value checks that no kpi is ouf of bounds (negative, percentage<=1) needs to be included
- test_time_summary()
test if the time summary is calculated correctly, needs to be included
- transformToDict(id, last_kpi)
transforms the kpi’s to a dict element
- Parameters:
id – label
last_kpi – bool, should the last kpi be saved in an extra sub dict
- Returns:
- update_basic_kpis()
calculates the basic kpi’s
Machine logger
Type |
KPI |
---|---|
Support |
[“TTFp”, “TTRp”, “FE”, “CMT”, “AUITp”, “AUBTp”, “ADOTp”, “AUSTp”, “APTp”, “AUPTp”, “AUSTTp”, “AUBLTp”, “PBTp”, “PRIp”] |
Basic |
[“A”, “AE”, “TE”, “UE”, “SeR, E, OEE, NEE”] |
- class ontologysim.ProductionSimulation.logger.MachineLogger.MachineLogger(logger)
Bases:
SubLogger
calculates all machine related kpi’s
- addElement(dict_element)
interface to the logger, all data from the simulation are provided through this class
- Parameters:
dict_element – {‘type’,’time_diff’,’event_onto_time’,……………}
- finale_evaluate(time)
when the logging ends, a last evaluation must be calculated
- Parameters:
time –
- Returns:
- finale_evaluate_summary_api(time)
finale evaluate summary report for api :param time: int :return: list
- initSubLogger(log_type_dict)
initializing of sub_logger, set up the time and summarized kpi dict
- Parameters:
dict_element – information from config
- save_to_database()
save data to database :return:
- setTTFlastValue(start_logging_time)
set the last failure value to the last value dict
- Parameters:
start_logging_time –
- update_basic_kpis()
calculates the basic kpi’s
Transporter logger
Type |
KPI |
---|---|
Support |
[“TTFp”, “TTRp”, “FE”, “CMTp”,”ADOTp”, “AUITp”, “AUSTp”, “AUTTp”] |
Basic |
[] |
- class ontologysim.ProductionSimulation.logger.TransporterLogger.TransporterLogger(logger)
Bases:
SubLogger
calculates all transporter related kpi’s
- addElement(dict_element)
interface to the logger, all data from the simulation are provided through this class
- Parameters:
dict_element – {‘type’,’time_diff’,’event_onto_time’,……………}
- finale_evaluate(time)
when the logging ends, a last evaluation must be calculated
- Parameters:
time –
- Returns:
- finale_evaluate_summary_api(time)
when the logging ends, a last evaluation must be calculated
- Parameters:
time –
- Returns:
- initSubLogger(log_type_dict)
initializing of sub_logger, set up the time and summarized kpi dict
- Parameters:
dict_element – information from config
- Returns:
- save_to_database()
save to database :return:
- setTTFlastValue(start_logging_time)
set for kpi ttf last value :param start_logging_time: :return:
- update_basic_kpis()
calculates the basic kpi’s
Product analyse logger
Type |
KPI |
---|---|
Support |
[“ProductType”, “WIP”, “ATTp”, “AQMTp”, “AUSTp”, “APTp”, “AUPTp”, “AUSTnpp”, “AOETp”, “PPTp”] |
Basic |
[“TR”] |
- class ontologysim.ProductionSimulation.logger.ProductAnalyseLogger.ProductAnalyseLogger(logger)
Bases:
SubLogger
calculates all product related kpi’s
- addElement(dict_element)
interface to the logger, all data from the simulation are provided through this class
- Parameters:
dict_element – {‘type’,’time_diff’,’event_onto_time’,……………}
- addTimeElement(object_name, kpi_key_list, time, time_diff)
override the add time element of Sub logger, because of the AOET KPI adds a new value to the time element (time intervall)
- Parameters:
object_name – label
kpi_key_list – [KPI’s name]
time – double
time_diff – double
- Returns:
- calculateWIP(end_time_intervall)
calculates the wip for one logging time intervall
- Parameters:
edn_time_intervall – edn of the time element
- Returns:
- calculateWIPTimeDiff(time_diff, end_time, object_name)
calculate the WIP for a given time intervall
- Parameters:
time_diff –
end_time –
object_name –
- Returns:
- check_product(product_name, time, event_type=None, time_diff=0)
if the product has never been logged before than the last value is set,and the product type is saved in a dict for faster access
- Parameters:
product_name –
time –
event_type –
time_diff –
- Returns:
- finale_evaluate(time)
when the logging ends, a last evaluation must be calculated
- Parameters:
time –
- Returns:
- finale_evaluate_summary_api(time)
finale evaluate kpi for api usage :param time: :return:
- getProductList()
- getSummaryList()
- Returns:
- getSummaryListAPI(summarized_data)
transfrom dict of summary kpi data to list :param summarized_data: :return:
- getTimeList(object_key)
override :param object_key: :return:
- initSubLogger(log_type_dict)
initializing of sub_logger, set up the time and summarized kpi dict
- Parameters:
dict_element – information from config
- save_to_csv(path, folder_name, summarized_name)
save data to csv :param path: :param folder_name: :param summarized_name: :return:
- save_to_database()
save data to database :return:
- setLastWIP(time)
calculates the wpi to the given time and saves the value in the wip dict
- Parameters:
time – double
- test_object_name_all()
test method which checks, if the objects calculated together are the equal to the all value checks that no kpi is ouf of bounds (negative, percentage<=1) needs to be included
- update_basic_kpis()
calculates the basic kpi’s
Queue fill level logger
Type |
KPI |
---|---|
Support |
[“FillLevel”] |
Basic |
[] |
- class ontologysim.ProductionSimulation.logger.QueueFillLevelLogger.QueueFillLevelLogger(logger)
Bases:
SubLogger
calculates all queue fill level related kpi’s
- addElement(dict_element)
interface to the logger, all data from the simulation are provided through this class
- Parameters:
dict_element – {‘type’,’time_diff’,’event_onto_time’,……………}
- evaluate(time)
calcualtes the kpi
- Parameters:
time –
- finale_evaluate(time)
when the logging ends, a last evaluation must be calculated
- Parameters:
time –
- finale_evaluate_summary_api(time)
when the logging ends, a last evaluation must be calculated
- Parameters:
time –
- initSubLogger(log_type_dict)
initializing of sub_logger, set up the time and summarized kpi dict
- Parameters:
dict_element – information from config
- save_to_database()
save to database :return:
- setQueueSize(time)
calculates the current number of parts in a queue
- Parameters:
time –
- Returns:
Simulation logger
Type |
KPI |
---|---|
Support |
[“WIP”,”logging_time”] |
Basic |
[“AR”, “PR”] |
- class ontologysim.ProductionSimulation.logger.SimLogger.SimLogger(logger)
Bases:
SubLogger
calculates all simulation related kpi’s
- addElement(dict_element)
interface to the logger, all data from the simulation are provided through this class
- Parameters:
dict_element – {‘type’,’time_diff’,’event_onto_time’,……………}
- addWIPTimeElement(kpi_key_list, time, time_diff, wip)
adds a new value to the time element (time intervall)
- Parameters:
object_name – label
kpi_key_list – [KPI’s name]
time – double
time_diff – double
- Returns:
- finale_evaluate(time)
when the logging ends, a last evaluation must be calculated
- Parameters:
time –
- Returns:
- finale_evaluate_summary_api(time, machineSummary, productSummary)
finale evalueate for api
- Parameters:
time –
machineSummary –
productSummary –
- Returns:
- getSummaryList()
transfrom dict of summary kpi data to list :return:
- getSummaryListAPI(summarized_data)
transfrom dict of summary kpi data to list :param summarized_data: :return:
- getTimeList()
transform dict of time kpi data to list :return:
- initSubLogger(log_type_dict)
initializing of sub_logger, set up the time and summarized kpi dict
- Parameters:
dict_element – information from config
- save_to_csv(path, folder_name, summarized_name)
saves the kpi to a csv
- Parameters:
path –
folder_name –
summarized_name –
- Returns:
- save_to_database()
save to database :return:
- setLastWIP()
calculates the wip and save the value to last wip
- Returns:
- update_basic_kpis()
calculates the basic kpi’s
Transporter distribution logger
- class ontologysim.ProductionSimulation.logger.TransporterDistributionLogger.TransporterDistributionLogger(logger)
Bases:
SubLogger
no kpi is getting calculated, is used for analysing the distribution of the transporter
- addElement(dict_element)
interface to the logger, all data from the simulation are provided through this class
- Parameters:
dict_element – {‘type’,’time_diff’,’event_onto_time’,……………}
- evaluate(time)
summarizes all values in one time intervall
- Parameters:
time –
- finale_evaluate(time)
when the logging ends, a last evaluation must be calculated
- Parameters:
time –
- initSubLogger(log_type_dict)
initializing of sub_logger, set up the time and summarized kpi dict
- Parameters:
dict_element – information from config
- save_to_database()
save data to database :return: