Class SimulationInformation

java.lang.Object
fr.ifremer.isisfish.datastore.SimulationInformation

public class SimulationInformation extends Object
Cette classe permet de conserver des informations sur le deroulement d'une simulation. La plupart des informations sont automatiquement renseignees, mais l'utilisateur peut lui aussi ajouter des informations avec la methode addInformation(String).
Version:
$Revision$ Last update: $Date$ by : $Author$
Author:
poussin
  • Field Details

  • Constructor Details

    • SimulationInformation

      public SimulationInformation(File file)
      Constructor. If file already exists, load his content into current instance.
      Parameters:
      file - simulation information output file
  • Method Details

    • reloadLocal

      public void reloadLocal()
      Si les simulations ont été effectuée à distance, l'instance de SimulationInformation doit se recharger avec les nouvelles informations à jour en fin de simulation.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • store

      protected void store()
    • setInfo

      protected void setInfo(String key, String value)
    • getSimulationStart

      public Date getSimulationStart()
      Get the date of simulation start.
      Returns:
      simulation start date
    • setSimulationStart

      public void setSimulationStart(Date date)
    • getSimulationEnd

      public Date getSimulationEnd()
      Get the date of simulation start.
      Returns:
      simulation end date
    • setSimulationEnd

      public void setSimulationEnd(Date date)
    • addExportTime

      public void addExportTime(String exportName, long time)
    • addExportSize

      public void addExportSize(String exportName, long size)
    • addExportException

      public void addExportException(String exportName, Throwable eee)
    • addAllExportTime

      public void addAllExportTime(long time)
    • addAllExportSize

      public void addAllExportSize(long size)
    • getExportTimes

      protected Map<String,Long> getExportTimes()
      Get all export time in map.
      Returns:
      a map with all export time
    • getExportSizes

      protected Map<String,Long> getExportSizes()
      Get all export size in map.
      Returns:
      a map with all export size
    • getExportExceptions

      protected Map<String,String> getExportExceptions()
      Get all export exception in map.
      Returns:
      a map with all export exception
    • getExportTime

      public Map<String,Long> getExportTime()
      Deprecated.
      since 3.2.0.5, use getExportTimes() instead
      Get all export time in map.
      Returns:
      a map with all export time
    • getLong

      protected long getLong(String prop)
    • getExportTime

      public long getExportTime(String exportName)
    • getExportSize

      public long getExportSize(String exportName)
    • getAllExportTime

      public long getAllExportTime()
    • getAllExportSize

      public long getAllExportSize()
    • addRuleTime

      protected void addRuleTime(String keyName, String ruleName, long time)
      Add rule time. If a time already exists for ruleName, add time to previous time. (usefull because pre/post action are called multiples time)
      Parameters:
      keyName - (ie #RULE_TIME_INIT, #RULE_TIME_PRE, #RULE_TIME_POST)
      ruleName - rule name
      time - time to add
      Since:
      3.2.0.5
    • addRuleInitTime

      public void addRuleInitTime(String ruleName, long time)
      Add rule init time. If a time already exists for ruleName, add time to previous time.
      Parameters:
      ruleName - rule name
      time - time to add
      Since:
      3.2.0.5
    • addRulePreTime

      public void addRulePreTime(String ruleName, long time)
      Add rule pre operation time time. If a time already exists for ruleName, add time to previous time.
      Parameters:
      ruleName - rule name
      time - time to add
      Since:
      3.2.0.5
    • addRulePostTime

      public void addRulePostTime(String ruleName, long time)
      Add rule post operation time. If a time already exists for ruleName, add time to previous time.
      Parameters:
      ruleName - rule name
      time - time to add
      Since:
      3.2.0.5
    • getRuleInitTime

      public long getRuleInitTime(String ruleName)
      Get rule init operation time.
      Parameters:
      ruleName - rule name
      Returns:
      time
      Since:
      3.2.0.5
    • getRulePreTime

      public long getRulePreTime(String ruleName)
      Get rule pre operation time.
      Parameters:
      ruleName - rule name
      Returns:
      time
      Since:
      3.2.0.5
    • getRulePostTime

      public long getRulePostTime(String ruleName)
      Get rule post operation time.
      Parameters:
      ruleName - rule name
      Returns:
      time
      Since:
      3.2.0.5
    • getRuleTime

      protected long getRuleTime(String prefixName, String ruleName)
      Get rule operation time.
      Parameters:
      ruleName - rule name
      Since:
      3.2.0.5
    • getRuleNames

      protected Set<String> getRuleNames()
      Get rules names.
      Returns:
      a map with all export time
    • getStatistic

      public String getStatistic()
    • setStatistic

      public void setStatistic(String v)
    • getComputeResult

      public String getComputeResult()
    • setComputeResult

      public void setComputeResult(String v)
    • getOptimizationUsage

      public String getOptimizationUsage()
    • setOptimizationUsage

      public void setOptimizationUsage(String v)
    • getException

      public String getException()
    • setException

      public void setException(Throwable eee)
    • exceptionToString

      protected String exceptionToString(Throwable eee)
    • hasError

      public boolean hasError()
      Return true if an exception has been set.
      Returns:
      true if there is an exception
    • getInfomation

      public String getInfomation()
      Deprecated.
      since 3.2.0.5, use getInformation() instead
      Returns:
      other information
    • getInformation

      protected String getInformation()
      Get other information.
      Returns:
      other information
    • addInformation

      public void addInformation(String info)
      Add additional simulation information.
      Parameters:
      info - new info