Ejemplo n.º 1
0
        public override void StartSimulation(IRTIambassador rtiAmb)
        {
            if (log.IsInfoEnabled)
            {
                log.Info("Start Time Management simulation");
            }

            try
            {
                rti      = (XrtiExecutiveAmbassador)rtiAmb;
                form     = new TimeManagementForm(rti, this);
                scenario = form.Scenario;

                federateAmbassador = new TimeManagementFederateAmbassador(rtiAmb);
                timeManagementFederateAmbassador = (TimeManagementFederateAmbassador)federateAmbassador;
                mobileServices = new MobileFederateServices(new DoubleValuedLogicalTimeFactory(), new DoubleValuedLogicalTimeIntervalFactory());
                JoinSimulation(rtiAmb, federate.Type, federation.Name);

                AddVisualElements();

                InitFederate();

                // Add Federation's interaction listener
                TimeManagementObjectModelInteractionListener l1 = new TimeManagementObjectModelInteractionListener(rti, mobileServices._timeFactory, home, moveActorInterval, form, this);
                rti.interactionManager.AddInteractionListener(l1);

                MyLowLevelManagementObjectModelInteractionListener l2 = new MyLowLevelManagementObjectModelInteractionListener(rti, "My", form);
                rti.interactionManager.AddInteractionListener(l2);
 public TimeManagementObjectModelInteractionListener(XrtiExecutiveAmbassador aRti, 
     ILogicalTimeFactory aTimeFactory, Home home, ILogicalTimeInterval moveActorInterval,
     TimeManagementForm form, TimeManagementSimulation simulation)
 {
     this.rti = aRti;
     this.timeFactory = aTimeFactory;
     this.home = home;
     this.moveActorInterval = moveActorInterval;
     this.form = form;
     this.simulation = simulation;
 }
 public TimeManagementObjectModelInteractionListener(XrtiExecutiveAmbassador aRti,
                                                     ILogicalTimeFactory aTimeFactory, Home home, ILogicalTimeInterval moveActorInterval,
                                                     TimeManagementForm form, TimeManagementSimulation simulation)
 {
     this.rti               = aRti;
     this.timeFactory       = aTimeFactory;
     this.home              = home;
     this.moveActorInterval = moveActorInterval;
     this.form              = form;
     this.simulation        = simulation;
 }
Ejemplo n.º 4
0
 public MyLowLevelManagementObjectModelInteractionListener(XrtiExecutiveAmbassador p, String aName, TimeManagementForm form)
     : base(p, aName)
 {
     this.form = form;
 }
 public MyLowLevelManagementObjectModelInteractionListener(XrtiExecutiveAmbassador p, String aName, TimeManagementForm form)
     : base(p, aName)
 {
     this.form = form;
 }