public PetriNetwork(Random rand, string fileName, string name, string certificateSubject, DateTime lastModificationDate, string description, FireRule fireRule) { this.rand = rand; this.fileName = fileName; this.name = name; this.certificateSubject = certificateSubject; this.lastModificationDate = lastModificationDate; this.description = description; this.fireRule = fireRule; this.eventTrunk = new EventTrunk(); this.items = new List<AbstractItem>(); this.stateHierarchy = new StateHierarchy(); this.transitionHistory = new List<TransitionHistoryItem>(); this.stateMatrix = new List<StateVector>(); this.handlers = new Dictionary<String, PetriHandler>(); this.unidGenNumber = 0; this.stateGenNumber = 0; this.statePrefix = "S"; }
private static PetriNetwork openSettingsFromXml(Random rand, XmlNodeList root, string fileName) { string name = "new"; string certificateSubject = ""; DateTime lastModificationDate = DateTime.Now; string description = ""; int simulationTimeout = PetriNetwork.DEF_TIMEOUT; FireRule fireRule = FireRule.RANDOM; EventTrunk events = new EventTrunk(); foreach (XmlNode node in root) { string namespaceUri = node.NamespaceURI; string localName = node.LocalName; switch (namespaceUri) { case PetriXmlHelper.XML_SETTINGS_NAMESPACE: switch (localName) { case "Name": name = PetriNetwork.openStringData(node); break; case "CertificateSubject": certificateSubject = PetriNetwork.openStringData(node); break; case "LastModificationDate": lastModificationDate = PetriNetwork.openDateTimeData(node); break; case "Description": description = PetriNetwork.openStringData(node); break; case "FireRule": fireRule = (FireRule)Enum.Parse(typeof(FireRule), PetriNetwork.openStringData(node)); break; case "SimulationTimeout": simulationTimeout = PetriNetwork.openIntData(node); break; } break; } } return new PetriNetwork(rand, fileName, name, certificateSubject, lastModificationDate, description, fireRule); }
public AbstractEventDrivenItem(string name, long unid, bool showAnnotation) : base(name, unid, showAnnotation) { this.statistics = new GeneralStatistics(); this.eventTrunk = new EventTrunk(); }