The “host” package
The “host” package contains the “EvacuationHost” class which is responsible for creating and hosting the evacuation simulation. The full functionality of this class is provided in DIVAs. The implementation of the evacuation host creates an “EvacuationSimulation” and binds it to the “EvacuationHost”.
Implementation Steps
- Inside the package “edu.utdallas.mavs.evacuation.simulation.host” create a class named “EvacuationHost” that extends the abstract class “Host” defined in the package “edu.utdallas.mavs.divas.core.host”.
- The “EvacuationHost” provides concrete implementations for the abstract method “createSimulation” which is responsible for creating an instance of the evacuation simulation and associating it with the evacuation host.
The full implementation of the class “EvacuationHost” is provided in the following code.
package edu.utdallas.mavs.evacuation.simulation.host; import edu.utdallas.mavs.divas.core.host.Host; import edu.utdallas.mavs.divas.mts.MTSClient; import edu.utdallas.mavs.evacuation.simulation.sim.EvacuationSimulation; /** * This class describes a Host for simulations of evacuation scenarios. */ public class EvacuationHost extends Host { @Override protected void createSimulation(MTSClient client) { simulation = new EvacuationSimulation(client); } }