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

The “spectator” package

The spectator package maintains the current simulation state as received from the evacuation simulator. It only contains the “EvacuationPlayground” class.

Implementing the “EvacuationPlayground” class

The “EvacuationPlayground” class stores an updated evacuation simulation state as received from the simulator. To implement this class:

  1. Inside the package “edu.utdallas.mavs.evacuation.visualization.vis3D.spectator”, create a class named “EvacuationPlayground” that extends the class “PlayGround” defined in the package “edu.utdallas.mavs.divas.visualization.vis3D.spectator”.
  2. The class implementation describes the creation of 3D visualized objects. The following code provides the full implementation of this class.
package edu.utdallas.mavs.evacuation.visualization.vis3D.spectator;

import edu.utdallas.mavs.divas.core.sim.common.event.EnvEvent;
import edu.utdallas.mavs.divas.core.sim.common.state.AgentState;
import edu.utdallas.mavs.divas.core.sim.common.state.EnvObjectState;
import edu.utdallas.mavs.divas.visualization.vis3D.spectator.PlayGround;
import edu.utdallas.mavs.divas.visualization.vis3D.vo.AgentVO;
import edu.utdallas.mavs.divas.visualization.vis3D.vo.EnvObjectVO;
import edu.utdallas.mavs.divas.visualization.vis3D.vo.EventVO;
import edu.utdallas.mavs.evacuation.simulation.sim.common.state.EHumanAgentState;
import edu.utdallas.mavs.evacuation.visualization.vis3D.vo.EvacuationEnvObjectVO;
import edu.utdallas.mavs.evacuation.visualization.vis3D.vo.EvacuationEventVO;
import edu.utdallas.mavs.evacuation.visualization.vis3D.vo.EvacuationHumanAgentVO;

public class EvacuationPlayground extends PlayGround
{

    @Override
    protected AgentVO<?> createAgentVO(AgentState state, long cycle)
    {
        return new EvacuationHumanAgentVO((EHumanAgentState) state, cycle);
    }

    @Override
    protected EnvObjectVO createEnvObjectVO(EnvObjectState state, long cycle)
    {
        return new EvacuationEnvObjectVO(state, cycle);
    }

    @Override
    protected EventVO createEventVO(EnvEvent event, long cycle)
    {
        return new EvacuationEventVO(event, cycle);
    }

}