View Javadoc
1   /**
2    * 
3    */
4   package org.opentrafficsim.water.statistics;
5   
6   import com.thoughtworks.xstream.annotations.XStreamOmitField;
7   
8   import nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface;
9   
10  /**
11   * <br>
12   * Copyright (c) 2011-2013 TU Delft, Faculty of TBM, Systems and Simulation <br>
13   * This software is licensed without restrictions to Nederlandse Organisatie voor Toegepast Natuurwetenschappelijk Onderzoek TNO
14   * (TNO), Erasmus University Rotterdam, Delft University of Technology, Panteia B.V., Stichting Projecten Binnenvaart, Ab Ovo
15   * Nederland B.V., Modality Software Solutions B.V., and Rijkswaterstaat - Dienst Water, Verkeer en Leefomgeving, including the
16   * right to sub-license sources and derived products to third parties. <br>
17   * @version Mar 28, 2013 <br>
18   * @author <a href="http://tudelft.nl/averbraeck">Alexander Verbraeck </a>
19   */
20  public class XTimeTally extends XTally
21  {
22      /** */
23      @XStreamOmitField
24      private static final long serialVersionUID = 1L;
25  
26      /** */
27      @XStreamOmitField
28      private DEVSSimulatorInterface.TimeDoubleUnit simulator;
29  
30      /**
31       * @param description String; description of the statistic
32       * @param simulator DEVSSimulatorInterface.TimeDoubleUnit; the simulator
33       */
34      public XTimeTally(String description, DEVSSimulatorInterface.TimeDoubleUnit simulator)
35      {
36          super(description);
37          this.simulator = simulator;
38      }
39  
40      /**
41       * tally
42       * @param t double; previous time
43       */
44      public void tally(final double t)
45      {
46          super.tally(this.simulator.getSimulatorTime().si - t);
47      }
48  
49  }