+1 (972) 883-2091
ECSS 4.220, 800 W Campbell Rd, Richardson, TX 75083–0688, US

The “host” package contains the “TrafficHost” class which is responsible for creating and hosting the traffic simulation. The full functionality of this class is provided in DIVAs. The implementation of the traffic host creates a “TrafficSimulation” and binds it to the “TrafficHost”.

Implementation Steps

  1. Inside the package “edu.utdallas.mavs.traffic.simulation.host” create a class named “TrafficHost” that extends the abstract class “Host” defined in the package “edu.utdallas.mavs.divas.core.host”.
  2. The “TrafficHost” provides concrete implementations for the abstract method “createSimulation” which is responsible for creating an instance of the traffic simulation and associating it with the traffic host.

The full implementation of the class “TrafficHost” is provided in the following code.

package edu.utdallas.mavs.traffic.simulation.host;

import edu.utdallas.mavs.divas.core.host.Host;
import edu.utdallas.mavs.divas.mts.MTSClient;
import edu.utdallas.mavs.traffic.simulation.sim.TrafficSimulation;

/**
 * This class describes a Host for simulations of traffic scenarios.
 */
public class TrafficHost extends Host {
	@Override
	protected void createSimulation(MTSClient client) {
		simulation = new TrafficSimulation(client);
	}
}