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

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

class Source
extends java.lang.Object

A source maintains the volume of water it holds inside. It also knows its minimum and maximum volume, as well as the maximum natural volume of water it can absorb. It is the data model of water source.

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

Field Summary
private  double currentVolume
          Volume of water currently present in the source.
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_VOLUME_DELTA_PER_SECOND
          The maximum quantity of water that can come to the source from the outer environment, in liters per second.
protected static double NATURAL_MAX_VOLUME_LIMIT
          The maximal volume of water (in liters) that the source can ever absorb.
protected static double PUMP_POWER_PER_SECOND
          The quantity of water (in liters per second) pumped out from the source in one second, if the pump is running.
private  int sourceNumber
          The number of the source.
 
Constructor Summary
protected Source(int sourceNumber)
          Creates a new source 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 source.
protected  int getNumber()
          Returns the source's number.
protected  double getVolume()
          Reports the current volume of water in the source.
protected  void increaseVolume(double delta)
          Increases the volume of water in the source.
 
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

NATURAL_MAX_VOLUME_LIMIT

protected static final double NATURAL_MAX_VOLUME_LIMIT
The maximal volume of water (in liters) that the source can ever absorb. The Source Level High sensor is placed below this limit so the pump switches on before the source is actually completely full. This limit is an environmental constraint.

See Also:
Constant Field Values

PUMP_POWER_PER_SECOND

protected static final double PUMP_POWER_PER_SECOND
The quantity of water (in liters per second) pumped out from the source in one second, if the pump is running.

See Also:
Constant Field Values

MAX_VOLUME_DELTA_PER_SECOND

protected static final double MAX_VOLUME_DELTA_PER_SECOND
The maximum quantity of water that can come to the source from the outer environment, in liters per second.

See Also:
Constant Field Values

sourceNumber

private final int sourceNumber
The number of the source.


currentVolume

private double currentVolume
Volume of water currently present in the source.

Constructor Detail

Source

protected Source(int sourceNumber)
Creates a new source object and sets its volume to the exact middle of possible values.

Parameters:
sourceNumber - Number of the source.
Method Detail

getNumber

protected int getNumber()
Returns the source's number.

Returns:
The source's number.

increaseVolume

protected void increaseVolume(double delta)
Increases the volume of water in the source.

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

decreaseVolume

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

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

getVolume

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

Returns:
The current volume of water in the source.


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