Package teamwork :: Package test :: Package math :: Module testKeyedMatrix :: Class TestKeyedVector
[hide private]
[frames] | no frames]

Class TestKeyedVector

source code

       object --+        
                |        
unittest.TestCase --+    
                    |    
      testPWL.TestPWL --+
                        |
                       TestKeyedVector

Nested Classes [hide private]

Inherited from unittest.TestCase: failureException

Instance Methods [hide private]
 
setUp(self)
Hook method for setting up the test fixture before exercising it.
source code
KeyedVector instance
firstVector(self)
Generate the first state vector in an exhaustive sequence
source code
KeyedVector instance
nextVector(self, vec)
Return the next state vector in sequence following the given one
source code
 
verifyAdd(self, row1, row2)
Checks a single addition between two vectors
source code
 
verifyScale(self, vec1, scale)
Checks a single product between vector and float scaling factor
source code
 
verifyMultiply(self, row1, row2)
Checks a single product between two vectors
source code
 
testMatrix(self) source code
 
testSet(self) source code
 
testVector(self) source code
 
testMatrixEdit(self) source code
 
testVectorAddition(self) source code
 
testVectorScaling(self) source code
 
testVectorDotProduct(self) source code
 
testMatrixTimesVector(self) source code
 
verifyMatrixVector(self, mat, vec)
Checks a single product between 2D and 1D matrices
source code
 
DONTtestVectorTimesMatrix(self) source code
 
verifyVectorMatrix(self, vector, matrix)
Checks a single product between 1D and 2D matrices
source code
 
testMatrixTimesMatrix(self) source code
 
testMatrixPlusMatrix(self) source code
 
DONTtestVectorMathExhaustive(self)
Verifies exhaustive space of generated math problems
source code
 
testDelta(self) source code
 
testVectorCopy(self) source code
 
testVectorXML(self) source code
 
testMatrixCopy(self) source code
 
testMatrixXML(self) source code
 
testFill(self) source code
 
testSetToMatrix(self) source code
 
testInvert(self) source code

Inherited from testPWL.TestPWL: verifyMatrix, verifyPlane, verifyTree, verifyVector

Inherited from unittest.TestCase: __call__, __init__, __repr__, __str__, assertAlmostEqual, assertAlmostEquals, assertEqual, assertEquals, assertFalse, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertRaises, assertTrue, assert_, countTestCases, debug, defaultTestResult, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, shortDescription, tearDown

Inherited from unittest.TestCase (private): _exc_info

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Variables [hide private]
str[] features = ['strength', 'dexterity', 'constitution', 'intellig...
a list of state features to use as test case
str[] agents = ['warrior', 'wizard', 'cleric', 'thief']
a list of entity names to use as test cases
float step = 0.5
the granularity of the iteration through vector space
int iterations = 10
the number of times to repeat each test
int horizon = 10
the number of steps to consider in a projection

Inherited from testPWL.TestPWL: precision

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

setUp(self)

source code 

Hook method for setting up the test fixture before exercising it.

Overrides: unittest.TestCase.setUp
(inherited documentation)

nextVector(self, vec)

source code 

Return the next state vector in sequence following the given one

Parameters:
  • vec (KeyedVector instance) - the current vector from the sequence
Returns: KeyedVector instance

verifyAdd(self, row1, row2)

source code 

Checks a single addition between two vectors

Parameters:

verifyScale(self, vec1, scale)

source code 

Checks a single product between vector and float scaling factor

Parameters:
  • vec1 (KeyedVector) - the vector to scale
  • scale (float) - the factor to scale vector by

verifyMultiply(self, row1, row2)

source code 

Checks a single product between two vectors

Parameters:

verifyMatrixVector(self, mat, vec)

source code 

Checks a single product between 2D and 1D matrices

Parameters:

verifyVectorMatrix(self, vector, matrix)

source code 

Checks a single product between 1D and 2D matrices

Parameters:

Class Variable Details [hide private]

features

a list of state features to use as test case
Type:
str[]
Value:
['strength',
 'dexterity',
 'constitution',
 'intelligence',
 'charisma',
 'wisdom']