cz.zcu.fav.kiv.jsimcasestudies.watersystem.model
Class Station

java.lang.Object
  |
  +--cz.zcu.fav.kiv.jsimcasestudies.watersystem.model.Station

class Station
extends java.lang.Object

A station object maintains the volume of water in the main tank. It is the data model of the main tank.

Version:
1.1 from 2004-03-19
Author:
Cesar ALLAIN, Jarda KACER

Field Summary
private  double currentVolume
          Volume of water currently present in the main tank.
protected static double HIGH_VOLUME_LIMIT
          The highest possible volume of water in the source, in liters.
protected static double LOW_VOLUME_LIMIT
          The lowest possible volume of water in the source, in liters.
protected static double MAX_OUTPUT_FLOW
          The maximum output flow in liters per second.
protected static double MAX_OUTPUT_FLOW_CHANGE_PER_SECOND
          The maximum change of output flow per one second.
private  SourceHardwareData[] sources
          Sources' hardware info.
 
Constructor Summary
protected Station(SourceHardwareData[] sources)
          Creates a new station object and sets its volume to the exact middle of possible values.
 
Method Summary
protected  void decreaseVolume(double delta)
          Decreases the volume of water in the tank.
protected  double getVolume()
          Reports the current volume of water in the tank.
protected  int howManyPumpsOn()
          Returns the number of pumps currently switched on.
protected  void increaseVolume(double delta)
          Increases the volume of water in the tank.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOW_VOLUME_LIMIT

protected static final double LOW_VOLUME_LIMIT
The lowest possible volume of water in the source, in liters. If the actual volume is below this limit, the hardware sensor will indicate low level.

See Also:
Constant Field Values

HIGH_VOLUME_LIMIT

protected static final double HIGH_VOLUME_LIMIT
The highest possible volume of water in the source, in liters. If the actual volume is above this limit, the hardware sensor will indicate high level.

See Also:
Constant Field Values

MAX_OUTPUT_FLOW

protected static final double MAX_OUTPUT_FLOW
The maximum output flow in liters per second. This constant is determined by the size of the output pipe.

See Also:
Constant Field Values

MAX_OUTPUT_FLOW_CHANGE_PER_SECOND

protected static final double MAX_OUTPUT_FLOW_CHANGE_PER_SECOND
The maximum change of output flow per one second. The actual change can be either positive or negative.

See Also:
Constant Field Values

currentVolume

private double currentVolume
Volume of water currently present in the main tank.


sources

private SourceHardwareData[] sources
Sources' hardware info. This is necessary for counting the current input flow from all sources whose pumps are currently switched on. Will be read only, not modified.

Constructor Detail

Station

protected Station(SourceHardwareData[] sources)
Creates a new station object and sets its volume to the exact middle of possible values.

Method Detail

increaseVolume

protected void increaseVolume(double delta)
Increases the volume of water in the tank. The upper limit is not specified.

Parameters:
delta - The amount of water that is added to the tank.

decreaseVolume

protected void decreaseVolume(double delta)
Decreases the volume of water in the tank.

Parameters:
delta - The amount of water that is taken away from the tank.

getVolume

protected double getVolume()
Reports the current volume of water in the tank.

Returns:
The current volume of water in the tank.

howManyPumpsOn

protected int howManyPumpsOn()
Returns the number of pumps currently switched on. Uses hardware data of all water sources of the model.

Returns:
The number of pumps currently switched on.


Copyright © 2000-2004 University of West Bohemia, FAV-KIV. All Rights Reserved. Build date 20040510