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
14   * Onderzoek TNO (TNO), Erasmus University Rotterdam, Delft University of Technology, Panteia B.V., Stichting Projecten
15   * Binnenvaart, Ab Ovo Nederland B.V., Modality Software Solutions B.V., and Rijkswaterstaat - Dienst Water, Verkeer en
16   * Leefomgeving, including the right to sub-license sources and derived products to third parties. <br>
17   * 
18   * @version Mar 28, 2013 <br>
19   * @author <a href="http://tudelft.nl/averbraeck">Alexander Verbraeck </a>
20   */
21  public class XTimeTally extends XTally
22  {
23      /** */
24      @XStreamOmitField
25      private static final long serialVersionUID = 1L;
26  
27      /** */
28      @XStreamOmitField
29      private DEVSSimulatorInterface.TimeDoubleUnit simulator;
30  
31      /**
32       * @param description description of the statistic
33       * @param simulator the simulator
34       */
35      public XTimeTally(String description, DEVSSimulatorInterface.TimeDoubleUnit simulator)
36      {
37          super(description);
38          this.simulator = simulator;
39      }
40  
41      /**
42       * tally
43       * 
44       * @param t previous time
45       */
46      public void tally(final double t)
47      {
48          super.tally(this.simulator.getSimulatorTime().si - t);
49      }
50  
51  }