Class WeatherServerApp

All Implemented Interfaces:
Application, CommunicationApplication, OperatingSystemAccess<ServerOperatingSystem>, EventProcessor

public class WeatherServerApp extends AbstractApplication<ServerOperatingSystem> implements CommunicationApplication
This class acts as an omniscient application for a server that warns vehicles about certain hazards on the road. The hazard is hard-coded for tutorial purposes, in more realistic scenarios the location would've been updated dynamically.
  • Constructor Details

    • WeatherServerApp

      public WeatherServerApp()
  • Method Details

    • onStartup

      public void onStartup()
      This method is called by the Application Simulator when the vehicle that has been equipped with this application enters the simulation. It is the first method called of this class during a simulation.
      Specified by:
      onStartup in interface Application
    • processEvent

      public void processEvent(Event event) throws Exception
      This method is called by mosaic-application when a previously triggered event is handed over to the application for processing. Events can be triggered be this application itself, e.g. to run a routine periodically.
      Specified by:
      processEvent in interface EventProcessor
      Parameters:
      event - The event to be processed
      Throws:
      Exception
    • onMessageReceived

      public void onMessageReceived(ReceivedV2xMessage receivedV2xMessage)
      Description copied from interface: CommunicationApplication
      Receive a V2X Message.
      Specified by:
      onMessageReceived in interface CommunicationApplication
      Parameters:
      receivedV2xMessage - the received message container.
    • onAcknowledgementReceived

      public void onAcknowledgementReceived(ReceivedAcknowledgement acknowledgement)
      Description copied from interface: CommunicationApplication
      Receive an acknowledgement from a previously sent V2X Message.
      Specified by:
      onAcknowledgementReceived in interface CommunicationApplication
      Parameters:
      acknowledgement - the acknowledgement object which contains the sent V2X Message and the acknowledgement status.
    • onCamBuilding

      public void onCamBuilding(CamBuilder camBuilder)
      Description copied from interface: CommunicationApplication
      This method is called when a CAM is build by different Simulation Units that support CAM connectivity.
      Specified by:
      onCamBuilding in interface CommunicationApplication
      Parameters:
      camBuilder - the builder for the CAM
    • onMessageTransmitted

      public void onMessageTransmitted(V2xMessageTransmission v2xMessageTransmission)
      Description copied from interface: CommunicationApplication
      This method is called when a V2X message is transmitted.
      Specified by:
      onMessageTransmitted in interface CommunicationApplication
      Parameters:
      v2xMessageTransmission - the container for the V2XMessage to be transmitted
    • onShutdown

      public void onShutdown()
      This method is called by mosaic-application when the simulation has finished.
      Specified by:
      onShutdown in interface Application