Class SimulationLogWriter

  • All Implemented Interfaces:
    akka.actor.Actor, ResultWriter, java.io.Closeable, java.lang.AutoCloseable

    public class SimulationLogWriter
    extends akka.actor.AbstractActor
    implements ResultWriter
    Log writer is a result writer implementation creates simulation logs containing simulation metrics.

    Author:
    Erhan Bagdemir
    • Nested Class Summary

      • Nested classes/interfaces inherited from class akka.actor.AbstractActor

        akka.actor.AbstractActor.ActorContext, akka.actor.AbstractActor.Receive
      • Nested classes/interfaces inherited from interface akka.actor.Actor

        akka.actor.Actor.emptyBehavior$, akka.actor.Actor.ignoringBehavior$
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      akka.actor.AbstractActor.Receive createReceive()  
      static <T extends SimulationLogFormatter>
      akka.actor.Props
      props​(java.lang.String pathToLogFile, T logFormatter)
      Static factory method to create a new instance of SimulationLogFormatter.
      void write​(LogEvent report)
      Adds a new log event into the simulation logging source.
      void write​(java.lang.String report)
      Adds a new log event as string into the simulation logging source.
      • Methods inherited from class akka.actor.AbstractActor

        akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, emptyBehavior, getContext, getSelf, getSender, postRestart, postStop, preRestart, preRestart, preStart, receive, receiveBuilder, self, sender, supervisorStrategy, unhandled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimulationLogWriter

        public SimulationLogWriter​(java.lang.String logFile,
                                   SimulationLogFormatter formatter)
        Constructs a new SimulationLogFormatter instance.
        Parameters:
        logFile - Path to the log file.
        formatter - Log formatter.
    • Method Detail

      • write

        public void write​(LogEvent report)
        Description copied from interface: ResultWriter
        Adds a new log event into the simulation logging source.
        Specified by:
        write in interface ResultWriter
        Parameters:
        report - Log event.
      • write

        public void write​(java.lang.String report)
        Description copied from interface: ResultWriter
        Adds a new log event as string into the simulation logging source.
        Specified by:
        write in interface ResultWriter
        Parameters:
        report - Log event.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • createReceive

        public akka.actor.AbstractActor.Receive createReceive()
        Specified by:
        createReceive in class akka.actor.AbstractActor