EventModelInfo getEventModelInfo(GeneratedCode.SimulationModelRoot model)
        {
            EventModelInfo   eventModel = new EventModelInfo();
            List <EventInfo> events     = null;

            for (int i = 0; i < model.EventModel.Length; i++)
            {
                if (events == null)
                {
                    events = getEventInfo("", model.EventModel[i]);
                }
                else
                {
                    System.Console.WriteLine("Error: there should only be one EventModel section!");
                    System.Environment.Exit(1);
                }
                foreach (EventInfo e in events)
                {
                    if (eventModel.events.ContainsKey(e.name))
                    {
                        System.Console.WriteLine("Error: multiple definition of " + e.name + " event type");
                        System.Environment.Exit(1);
                    }

                    if (e.parentName != "")
                    {
                        foreach (ParameterInfo p in eventModel.events[e.parentName].parameters.Values)
                        {
                            if (e.parameters.ContainsKey(p.name))
                            {
                                System.Console.WriteLine("Error: multiple parameters with name:" + p.name + " defined");
                                System.Environment.Exit(1);
                            }
                            e.parameters[p.name] = p;
                        }
                    }
                    eventModel.events[e.name] = e;
                }
            }
            return(eventModel);
        }
Beispiel #2
0
        EventModelInfo getEventModelInfo(GeneratedCode.SimulationModelRoot model)
        {
            EventModelInfo eventModel = new EventModelInfo();
            List<EventInfo> events = null;
            for (int i = 0; i < model.EventModel.Length; i++)
            {
                if (events == null)
                {
                    events = getEventInfo("", model.EventModel[i]);
                }
                else
                {
                    System.Console.WriteLine("Error: there should only be one EventModel section!");
                    System.Environment.Exit(1);
                }
                foreach (EventInfo e in events)
                {
                    if (eventModel.events.ContainsKey(e.name))
                    {
                        System.Console.WriteLine("Error: multiple definition of " + e.name + " event type");
                        System.Environment.Exit(1);
                    }

                    if (e.parentName != "")
                    {
                        foreach (ParameterInfo p in eventModel.events[e.parentName].parameters.Values)
                        {
                            if (e.parameters.ContainsKey(p.name))
                            {
                                System.Console.WriteLine("Error: multiple parameters with name:" + p.name + " defined");
                                System.Environment.Exit(1);
                            }
                            e.parameters[p.name] = p;
                        }
                    }
                    eventModel.events[e.name] = e;
                }
            }
            return eventModel;
        }
Beispiel #3
0
 public SimulationModelInfo()
 {
     objectModel = null;
     eventModel = null;
     simulationExecutionModel = null;
 }
Beispiel #4
0
 public SimulationModelInfo()
 {
     objectModel = null;
     eventModel  = null;
     simulationExecutionModel = null;
 }