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

Implementing the 2D Visualizer

The functionality of the 2D visualizer is fully implemented in DIVAs. To implement the 2D evacuation visualizer, the designer is only required to implement the “main” method that starts the 2D visualizer and to provide the required dependency injection.

Implementation Steps:

  1. Inside the package “edu.utdallas.mavs.evacuation.visualization.vis2D”, create a class named “EvacuationVisualizer2DMain” that contains the “main” method.
  2. Provide the following implementation for the “main” method:
package edu.utdallas.mavs.evacuation.visualization.vis2D;

import org.apache.log4j.PropertyConfigurator;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Stage;

import edu.utdallas.mavs.divas.visualization.guice.CommunicationModuleProvider;
import edu.utdallas.mavs.divas.visualization.guice.VisualizerModule;
import edu.utdallas.mavs.divas.visualization.vis2D.Visualizer2DApplication;
import edu.utdallas.mavs.divas.visualization.vis2D.Visualizer2DFrame;

 * This is the <code>main</code> class for the 2D visualizer.
 * <p>
 * This class initialize the 2D visualizer application and inject the dependencies
 * @version 4.0
public class EvacuationVisualizer2DMain
     * Starts the 2D visualizer
     * @param args
    public static void main(String args[])
        // reads configuration properties for log4j

        // Sets the simulation host IP and port properties
        CommunicationModuleProvider.setConnectionProperties(args[0].split(" ")[0], args[0].split(" ")[1]);

        final Injector injector = Guice.createInjector(Stage.PRODUCTION, new VisualizerModule());
        final Visualizer2DApplication visualizerApplication = injector.getInstance(Visualizer2DApplication.class);
        final Visualizer2DFrame visualizerFrame2D = injector.getInstance(Visualizer2DFrame.class);