Class SanityChecks

java.lang.Object
  extended by SanityChecks

public class SanityChecks
extends java.lang.Object

Just a series of simple checks to prevent stupid mismatches. A truly well-engineered solution would make it impossible to generate a mismatch. For version 1.0, we'll just make simple sanity checking available instead.

Since:
1.0

Constructor Summary
SanityChecks()
           
 
Method Summary
static boolean dimensionCheck(IAgent agent, double[] arrLfContState, StateBundle[] arrStates)
          Checks that the dimensionality of a continuous state vector, vector of discrete state descriptions, and agent internal state all match up.
static boolean stateCheck(IAgent agent, StateBundle[] arrStates)
          checks that the agent knows how to handle each state in the state array (and that the states are not null)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SanityChecks

public SanityChecks()
Method Detail

dimensionCheck

public static boolean dimensionCheck(IAgent agent,
                                     double[] arrLfContState,
                                     StateBundle[] arrStates)
Checks that the dimensionality of a continuous state vector, vector of discrete state descriptions, and agent internal state all match up.

Parameters:
agent - description
arrLfContState - continuous state state-vector
arrStates - array of discrete states (one for each agent)
Returns:
true if everything checks out, false otherwise

stateCheck

public static boolean stateCheck(IAgent agent,
                                 StateBundle[] arrStates)
checks that the agent knows how to handle each state in the state array (and that the states are not null)

Parameters:
agent - description
arrStates - array of discrete states (one for each agent)
Returns:
true if everything checks out, false otherwise