jmarkov
Class PropertiesState

java.lang.Object
  extended by jmarkov.State
      extended by jmarkov.PropertiesState
All Implemented Interfaces:
java.lang.Comparable<State>

public class PropertiesState
extends State

The states are characterized by an array of integer-valued properties, whose meaning will chnage from implementation to implementation. The class can be used as is or extended.

Version:
1.0a
Author:
German Riaņo. Universidad de los Andes.

Field Summary
protected  int[] prop
          This array contains the properties that characterize the state.
 
Constructor Summary
PropertiesState(int K)
          Constructs a State charcterized by K properties.
PropertiesState(int[] properties)
          Constructs a State with the given properties array.
PropertiesState(PropertiesState s)
          Constructs a new State by cloning the given State.
 
Method Summary
 java.lang.Object clone()
          Creates a ne PropertiesState Object with the same properties as this one.
 int compareTo(State s)
          The construction is made according to the values of the properties, starting from prop[0] to prop[K].
 void computeMOPs()
          By default it computes the long run average for each property. the user should override this method in order to compute more meaningful measures of performance.
 boolean equals(java.lang.Object s)
          Returns true if the given object s is equal to this.
 int[] getProperties()
           
 int getProperty(int index)
           
 java.lang.String label()
          Returns a string representation of this state in vector form.
protected  void setProperty(int index, int value)
          Sets the value of the propertie at the given index
 
Methods inherited from class jmarkov.State
addMOPName, clearMOPs, description, getMOP, getMOP, getMOPIndex, getMOPNames, getMOPNames, getNum, getRates, getRateToState, mopsNames, numMOPNames, setMOP, setMOP, setMOPNames, setRateToState, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

prop

protected final int[] prop
This array contains the properties that characterize the state.

Constructor Detail

PropertiesState

public PropertiesState(int K)
Constructs a State charcterized by K properties. The original values of all the properties is 0.


PropertiesState

public PropertiesState(int[] properties)
Constructs a State with the given properties array.


PropertiesState

public PropertiesState(PropertiesState s)
Constructs a new State by cloning the given State.

Method Detail

computeMOPs

public void computeMOPs()
By default it computes the long run average for each property. the user should override this method in order to compute more meaningful measures of performance.

Specified by:
computeMOPs in class State
See Also:
State.computeMOPs()

compareTo

public final int compareTo(State s)
The construction is made according to the values of the properties, starting from prop[0] to prop[K].

Specified by:
compareTo in interface java.lang.Comparable<State>
Specified by:
compareTo in class State
Returns:
A positive integer if this is grater then j, negative if this is less then j and 0 if this==j.

equals

public boolean equals(java.lang.Object s)
Returns true if the given object s is equal to this.(i.e. it is another PropertiesState with the same properties.

Overrides:
equals in class State

clone

public java.lang.Object clone()
Creates a ne PropertiesState Object with the same properties as this one.

Overrides:
clone in class java.lang.Object
See Also:
Object.clone()

label

public java.lang.String label()
Returns a string representation of this state in vector form. The String will be in the form (p1,p2,..,pK). A Class implementing this Class could give a more meaningful description.

Specified by:
label in class State

getProperties

public final int[] getProperties()
Returns:
Returns the properties array.

getProperty

public int getProperty(int index)
Parameters:
index -
Returns:
the propertie at the given index

setProperty

protected void setProperty(int index,
                           int value)
Sets the value of the propertie at the given index

Parameters:
index -
value -