static void PrintSimpleEventLog(SimpleEventLog simpleEventLog) { Console.WriteLine("L = ["); var i = 0; foreach (var trace in simpleEventLog.Traces()) { if (i > 0) { Console.WriteLine(","); } Console.Write($"<{trace.Id}>{trace.Quantity}"); i++; } Console.WriteLine(); Console.WriteLine("]"); }
public static void Start() { EventLogger = CreateEventLogger(); }
private static SimpleEventLog CreateEventLogger() { SimpleEventLog logger = new SimpleEventLog(m_ProductName); return(logger); }
static void Main(string[] args) { Console.WriteLine("Inform the path to event log:"); var filePath = Console.ReadLine(); if (!File.Exists(filePath)) { Console.WriteLine("File not found"); return; } Console.WriteLine("Print simple event log? (Y/N)"); var printSimpleEventLog = Console.ReadLine().ToUpper(); Console.WriteLine("Print relationships between activities? (Y/N)"); var printRelationships = Console.ReadLine().ToUpper(); Console.WriteLine(); Console.WriteLine("{0:HH:mm:ss.fff} - Loading event log", DateTime.Now); var eventLog = MXMLFile.LoadEventLog(filePath); //var eventLog = EventLogManual1(); //aula05.pdf pg 10 //var eventLog = EventLogManual2(); //aula03.pdf pg 33 //var eventLog = EventLogManual3(); //aula05.pdf L3 pg 17 //var eventLog = EventLogManual4(); //aula05.pdf L4 pg 17 Console.WriteLine(); Console.WriteLine("{0:HH:mm:ss.fff} - Building simple event log", DateTime.Now); var simpleEventLog = new SimpleEventLog(eventLog); if (printSimpleEventLog == "Y") { PrintSimpleEventLog(simpleEventLog); } Console.WriteLine(); Console.WriteLine("{0:HH:mm:ss.fff} - Searching relationships between activities", DateTime.Now); var listActivities = simpleEventLog.Activities(); var relashionshipMatrix = simpleEventLog.SearchRelationships(); if (printRelationships == "Y") { PrintRelationshipMatrix(relashionshipMatrix, listActivities); } Console.WriteLine(); Console.WriteLine("{0:HH:mm:ss.fff} - Building Petri Net", DateTime.Now); var petriNet = new PetriNet(simpleEventLog); var pnDefinition = petriNet.Definition(); PrintPetriNetDefinition(pnDefinition); Console.WriteLine(); Console.WriteLine("{0:HH:mm:ss.fff} - Done", DateTime.Now); }
public PetriNet(SimpleEventLog simpleEventLog) { this._simpleEventLog = simpleEventLog; }