#NEWLINE# def test_errs( ) : #NEWLINE# #INDENT# ' Ensure that we can call custom methods without error ' #NEWLINE# domain = PST ( NUM_UAV = 2 ) #NEWLINE# dummyState = domain . s0 ( ) #NEWLINE# rlpy_state = [ 1 , 2 , 9 , 3 , 1 , 0 , 1 , 1 ] #NEWLINE# internState = domain . state2Struct ( rlpy_state ) #NEWLINE# assert np . all ( ( internState . locations == [ 1 , 2 ] ) ) #NEWLINE# assert np . all ( ( internState . fuel == [ 9 , 3 ] ) ) #NEWLINE# assert np . all ( ( internState . actuator == [ 1 , 0 ] ) ) #NEWLINE# assert np . all ( ( internState . sensor == [ 1 , 1 ] ) ) #NEWLINE# locs = np . array ( [ 1 , 2 ] ) #NEWLINE# fuel = np . array ( [ 9 , 3 ] ) #NEWLINE# act = np . array ( [ 1 , 0 ] ) #NEWLINE# sens = np . array ( [ 1 , 1 ] ) #NEWLINE# sStruct = StateStruct ( locs , fuel , act , sens ) #NEWLINE# assert np . all ( ( domain . struct2State ( sStruct ) == [ 1 , 2 , 9 , 3 , 1 , 0 , 1 , 1 ] ) ) #NEWLINE# locs = np . array ( [ 1 , 2 ] ) #NEWLINE# fuel = np . array ( [ 9 , 3 ] ) #NEWLINE# act = np . array ( [ 1 , 0 ] ) #NEWLINE# sens = np . array ( [ 1 , 1 ] ) #NEWLINE# assert np . all ( ( domain . properties2StateVec ( locs , fuel , act , sens ) == [ 1 , 2 , 9 , 3 , 1 , 0 , 1 , 1 ] ) )