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 override void StartSimulation(IRTIambassador rtiAmb) { if (log.IsInfoEnabled) { log.Info("Start Boids simulation"); } JoinSimulation(rtiAmb, color, "Boids"); try { simulationThread = new Thread(new ThreadStart(SimulationLoop)); boidsManager = new BoidsManager(federateAmbassador); boidsManager.BuildBoids(NUMBER_BOIDS, new Vector3(750, 60, 750), color); BoidsSample app = new BoidsSample(boidsManager, color); simulationThread.Start(); app.Go(); } catch (Exception e) { if (log.IsErrorEnabled) { log.Error("Failed running simulation. Exception :" + e.Message); } } }
public virtual void JoinSimulation(IRTIambassador rtiAmb, string federateType, string federation) { if (rtiAmb == null) { throw new System.ArgumentNullException("Rti ambassador could not be null"); } rtiAmbassador = rtiAmb; InitLogSystem(); federationName = federation; try { //Build a Uri using a file path FileInfo file = new FileInfo(this.FomList[0].Uri); Uri fileUri = new Uri("file://" + file.FullName); //Create Federation rtiAmbassador.CreateFederationExecution(federationName, fileUri); } catch (Exception exception) { if (log.IsErrorEnabled) { log.Error(exception.Message); } } try { // PATCH ANGEL: Si está inicializado el federateAmbassador no se crea de nuevo if (federateAmbassador == null) { federateAmbassador = new XrtiFederateAmbassador(rtiAmbassador); } if (mobileServices == null) { mobileServices = new MobileFederateServices(new LongValuedLogicalTimeFactory(), new LongValuedLogicalTimeIntervalFactory()); } // Join to federation IFederateHandle federateHandle = rtiAmbassador.JoinFederationExecution(federateType, federationName, federateAmbassador, mobileServices); } catch (Exception e) { if (log.IsErrorEnabled) { log.Error("Failed while joining to :" + federateAmbassador + ". Exception :" + e.Message); } } }
public override void StartSimulation(IRTIambassador rtiAmb) { JoinSimulation(rtiAmb, "Europe", "HelloWorld"); try { internalThread = new Thread(new ThreadStart(SimulationLoop)); internalThread.Start(); } catch (Exception e) { if (log.IsErrorEnabled) { log.Error("Failed running simulation. Exception :" + e.Message); } } }
public override void StartSimulation(IRTIambassador rtiAmb) { if (log.IsInfoEnabled) { log.Info("Start Military simulation"); } JoinSimulation(rtiAmb, color, "Military"); try { form = new MilitaryForm(militaryScenario); form.Show(); //simulationThread = new Thread(new ThreadStart(SimulationLoop)); //simulationThread.Start(); } catch (Exception e) { if (log.IsErrorEnabled) { log.Error("Failed running simulation. Exception :" + e.Message); } } }
public override void StartSimulation(IRTIambassador rtiAmb) { if (log.IsInfoEnabled) log.Info("Start Military simulation"); JoinSimulation(rtiAmb, color, "Military"); try { form = new MilitaryForm(militaryScenario); form.Show(); //simulationThread = new Thread(new ThreadStart(SimulationLoop)); //simulationThread.Start(); } catch (Exception e) { if (log.IsErrorEnabled) log.Error("Failed running simulation. Exception :" + e.Message); } }
public override void StartSimulation(IRTIambassador rtiAmb) { if (log.IsInfoEnabled) log.Info("Start Boids simulation"); JoinSimulation(rtiAmb, color, "Boids"); try { simulationThread = new Thread(new ThreadStart(SimulationLoop)); boidsManager = new BoidsManager(federateAmbassador); boidsManager.BuildBoids(NUMBER_BOIDS, new Vector3(750, 60, 750), color); BoidsSample app = new BoidsSample(boidsManager, color); simulationThread.Start(); app.Go(); } catch (Exception e) { if (log.IsErrorEnabled) log.Error("Failed running simulation. Exception :" + e.Message); } }
public BaseAmbassador(IRTIambassador prtiAmbassador) { rtiAmbassador = prtiAmbassador; InitHandleCounter(); }
public TestFederate(IRTIambassador rtiAmbassador) : base(rtiAmbassador) { }
public TimeManagementFederateAmbassador(IRTIambassador prtiAmbassador)//, TimeManagementForm aForm) : base(prtiAmbassador) { //this.form = aForm; }
public FederateAmbassador(IRTIambassador prtiAmbassador) : base(prtiAmbassador) { rti = ((XrtiExecutiveAmbassador)rtiAmbassador); }
public FederateHelper(IRTIambassador ambassador) { rtiAmbassador = ambassador; }
//private IHLAfederate federate; public XrtiFederateAmbassador(IRTIambassador prtiAmbassador) : base(prtiAmbassador) { }
public MetaFederateAmbassador(IRTIambassador prtiAmbassador) : base(prtiAmbassador) { }
//, TimeManagementForm aForm) public TimeManagementFederateAmbassador(IRTIambassador prtiAmbassador) : base(prtiAmbassador) { //this.form = aForm; }
public abstract void StartSimulation(IRTIambassador rtiAmb);