├── bishop.egg-info ├── not-zip-safe ├── dependency_links.txt ├── top_level.txt ├── requires.txt ├── PKG-INFO └── SOURCES.txt ├── Bishop ├── Fonts │ └── estre.ttf ├── Maps │ ├── OneGoalExample │ │ ├── OneGoal_Example │ │ ├── TwoGoal_Example │ │ ├── OneGoal_Example.ini │ │ └── TwoGoal_Exampley.ini │ ├── ShoreMaps │ │ ├── Shore_Map │ │ ├── Shore_RO_EO.ini │ │ ├── Shore_RO_ES.ini │ │ ├── Shore_RS_EO.ini │ │ └── Shore_RS_ES.ini │ ├── FlagMaps │ │ ├── LongFlag_SymmetricB │ │ ├── LongFlag_AsymmetricB │ │ ├── LongFlag_Symmetric │ │ ├── LongFlag_Asymmetric │ │ ├── Flag_Map │ │ ├── Flag_Sym_OneR.ini │ │ ├── Flag_Asym_OneR.ini │ │ ├── Flag_Asym_OneRB.ini │ │ ├── Flag_Sym_OneRB.ini │ │ ├── Flag_Sym_OneR_Dist.ini │ │ ├── Flag_Asym_OneR_Dist.ini │ │ ├── Flag_Asym_OneR_DistB.ini │ │ ├── Flag_Asym_TwoR.ini │ │ ├── Flag_Sym_OneR_DistB.ini │ │ ├── Flag_Sym_TwoR.ini │ │ ├── Flag_Sym_TwoRB.ini │ │ ├── Flag_Asym_TwoRB.ini │ │ ├── Flag_Asym_TwoR_Dist.ini │ │ ├── Flag_Sym_TwoR_Dist.ini │ │ ├── Flag_Sym_TwoR_DistB.ini │ │ ├── Flag_Asym_TwoR_DistB.ini │ │ ├── Flag_Asym_TwoR_DistInv.ini │ │ └── Flag_Asym_TwoR_InvertedR.ini │ ├── BayesBookExampleMaps │ │ ├── CRInference_base │ │ ├── GoalInference_base │ │ ├── CRInference_base.ini │ │ └── GoalInference_base.ini │ ├── MoralWorld │ │ ├── MoralWorld │ │ ├── MoralWorld_Large │ │ ├── MoralWorld_FC.ini │ │ ├── MoralWorld_FE.ini │ │ ├── MoralWorld_SC.ini │ │ ├── MoralWorld_SE.ini │ │ ├── MoralWorldLarge_FC.ini │ │ ├── MoralWorldLarge_FE.ini │ │ ├── MoralWorldLarge_SC.ini │ │ └── MoralWorldLarge_SE.ini │ ├── PondMaps2Agents │ │ ├── Pond_OT │ │ ├── Pond_TT │ │ ├── P_Org_OT_ORE_2Ag.ini │ │ ├── P_Org_TT_ORE_2Ag.ini │ │ ├── P_Org_TT_ORC_2Ag.ini │ │ ├── P_Org_OT_TRC_2Ag.ini │ │ ├── P_Org_OT_TRE_2Ag.ini │ │ ├── P_Org_TT_TRC_2Ag.ini │ │ └── P_Org_TT_TRE_2Ag.ini │ ├── PondMapsOneObjCap │ │ ├── Pond_OT │ │ ├── Pond_TT │ │ ├── P_OT.ini │ │ ├── P_TT.ini │ │ ├── P_OT_ORC.ini │ │ ├── P_OT_ORE.ini │ │ ├── P_TT_ORC.ini │ │ ├── P_TT_ORE.ini │ │ ├── P_OT_TRC.ini │ │ ├── P_OT_TRE.ini │ │ ├── P_TT_TRE.ini │ │ └── P_TT_TRC.ini │ ├── PondMapsTwoObjs │ │ ├── Pond_OT │ │ ├── Pond_TT │ │ ├── P_OT_TRC_2Ob.ini │ │ ├── P_OT_TRE_2Ob.ini │ │ ├── P_TT_TRC_2Ob.ini │ │ └── P_TT_TRE_2Ob.ini │ ├── PondAlternativeModels │ │ ├── Pond_OT │ │ ├── Pond_TT │ │ ├── P_OT_ORC_FC.ini │ │ ├── P_OT_ORE_FC.ini │ │ ├── P_TT_ORC_FC.ini │ │ ├── P_TT_ORE_FC.ini │ │ ├── P_OT_TRC_FC.ini │ │ ├── P_OT_TRE_FC.ini │ │ ├── P_TT_TRC_FC.ini │ │ ├── P_TT_TRE_FC.ini │ │ ├── P_OT_ORC_FR.ini │ │ ├── P_OT_ORE_FR.ini │ │ ├── P_TT_ORC_FR.ini │ │ ├── P_TT_ORE_FR.ini │ │ ├── P_OT_TRC_FR.ini │ │ ├── P_OT_TRE_FR.ini │ │ ├── P_TT_TRC_FR.ini │ │ └── P_TT_TRE_FR.ini │ ├── PondMapsObjectAgent │ │ ├── Pond_OT │ │ ├── Pond_TT │ │ ├── P_OT_ORT_1Ob_AT.ini │ │ ├── P_TT_ORC_1Ob_AT.ini │ │ ├── P_Org_OT_ORT_1Ob_AT.ini │ │ ├── P_Org_TT_ORC_1Ob_AC.ini │ │ ├── P_Org_TT_ORC_1Ob_AT.ini │ │ ├── P_TT_ORC_1Ob_AC.ini │ │ ├── P_OT_TRC_2Ob_AB.ini │ │ ├── P_OT_TRC_2Ob_AT.ini │ │ ├── P_OT_TRE_2Ob_AB.ini │ │ ├── P_OT_TRE_2Ob_AT.ini │ │ ├── P_TT_TRC_2Ob_AB.ini │ │ ├── P_TT_TRC_2Ob_AT.ini │ │ ├── P_TT_TRE_2Ob_AB.ini │ │ ├── P_TT_TRE_2Ob_AT.ini │ │ ├── P_Org_OT_TRC_2Ob_AB.ini │ │ ├── P_Org_OT_TRC_2Ob_AT.ini │ │ ├── P_Org_OT_TRE_2Ob_AB.ini │ │ ├── P_Org_OT_TRE_2Ob_AT.ini │ │ ├── P_Org_TT_TRC_2Ob_AB.ini │ │ ├── P_Org_TT_TRC_2Ob_AT.ini │ │ ├── P_Org_TT_TRE_2Ob_AB.ini │ │ └── P_Org_TT_TRE_2Ob_AT.ini │ ├── ShoreMaps_Long │ │ ├── LongShore_Map │ │ ├── LongShore_ROF.ini │ │ ├── LongShore_ROC.ini │ │ ├── LongShore_RO_EO.ini │ │ ├── LongShore_RO_ES.ini │ │ ├── LongShore_RSC.ini │ │ ├── LongShore_RSF.ini │ │ ├── LongShore_RS_EO.ini │ │ └── LongShore_RS_ES.ini │ ├── SimpleGoalMap │ │ ├── SimpleMap │ │ └── SimpleGoalMap.ini │ ├── HallwaysMaps │ │ ├── Hallways_base │ │ ├── Hallways_base.ini │ │ ├── Hallways_CK_RI.ini │ │ ├── Hallways_CK_RK.ini │ │ ├── Hallways_CI_RI.ini │ │ ├── Hallways_CI_RK.ini │ │ ├── Hallways_base_prior.ini │ │ ├── Hallways_invRewards.ini │ │ └── Hallways_inv_CK_RK.ini │ ├── ControlFlagMaps │ │ ├── LongFlag_Symmetric_FC │ │ ├── LongFlag_Symmetric │ │ ├── LongFlag_Asymmetric │ │ ├── Flag_Asym_OneR_FC.ini │ │ ├── Flag_Asym_OneR_FR.ini │ │ ├── Flag_Asym_OneR_Dist_FC.ini │ │ ├── Flag_Asym_TwoR_FR.ini │ │ ├── Flag_Sym_TwoR_FR.ini │ │ ├── Flag_Asym_OneR_Dist_FR.ini │ │ ├── Flag_Asym_TwoR_Dist_FR.ini │ │ ├── Flag_Asym_TwoR_FC.ini │ │ ├── Flag_Sym_TwoR_Dist_FR.ini │ │ ├── Flag_Sym_TwoR_FC.ini │ │ ├── Flag_Asym_TwoR_Dist_FC.ini │ │ └── Flag_Sym_TwoR_Dist_FC.ini │ ├── RecombinationMaps │ │ ├── LongFlag_Asymmetric │ │ ├── Recomb_base │ │ ├── Recomb_inverse │ │ ├── Recomb_TerrainFlip.ini │ │ ├── Recomb_TerrainRewardFlip.ini │ │ ├── Recomb_RewardFlip.ini │ │ └── Recomb_base.ini │ ├── PredictionControlMaps │ │ ├── Prediction_base_control │ │ ├── Prediction_RFlip_TFlip_control.ini │ │ ├── Prediction_RKeep_TFlip_control.ini │ │ ├── Prediction_RFlip_TKeep_control.ini │ │ ├── Prediction_RFlip_TLeft_control.ini │ │ ├── Prediction_RFlip_TRight_control.ini │ │ ├── Prediction_RLeft_TLeft_control.ini │ │ ├── Prediction_RLeft_TRight_control.ini │ │ ├── Prediction_RRight_TLeft_control.ini │ │ ├── Prediction_RRight_TRight_control.ini │ │ ├── Prediction_base_control.ini │ │ ├── Prediction_RKeep_TKeep_control.ini │ │ ├── Prediction_RKeep_TLeft_control.ini │ │ ├── Prediction_RKeep_TRight_control.ini │ │ ├── Prediction_RLeft_TFlip_control.ini │ │ ├── Prediction_RLeft_TKeep_control.ini │ │ ├── Prediction_RRight_TFlip_control.ini │ │ └── Prediction_RRight_TKeep_control.ini │ └── PredictionTaskMaps │ │ ├── Prediction_terrainleftuniform │ │ ├── Prediction_base │ │ ├── Prediction_terrainrightuniform │ │ ├── Prediction_terrainflip │ │ ├── Prediction_RFlip_TFlip.ini │ │ ├── Prediction_RKeep_TFlip.ini │ │ ├── Prediction_RFlip_TKeep.ini │ │ ├── Prediction_RFlip_TLeft.ini │ │ ├── Prediction_RFlip_TRight.ini │ │ ├── Prediction_base.ini │ │ ├── Prediction_RKeep_TKeep.ini │ │ ├── Prediction_RLeft_TLeft.ini │ │ ├── Prediction_RLeft_TRight.ini │ │ ├── Prediction_RRight_TLeft.ini │ │ ├── Prediction_RKeep_TLeft.ini │ │ ├── Prediction_RRight_TRight.ini │ │ ├── Prediction_RKeep_TRight.ini │ │ ├── Prediction_RLeft_TKeep.ini │ │ ├── Prediction_RRight_TKeep.ini │ │ ├── Prediction_RLeft_TFlip.ini │ │ └── Prediction_RRight_TFlip.ini ├── __init__.py ├── Examples │ ├── SimpleInference.py │ ├── SimulateAgents.py │ └── DetailedInference.py ├── AgentSimulation.py ├── MDP.py ├── Agent.py └── AuxiliaryFunctions.py ├── dist ├── Bishop-3-py3.8.egg ├── Bishop-2.6-py2.7.egg ├── Bishop-1.0.0-py2.7.egg ├── Bishop-2.0.0-py2.7.egg ├── Bishop-2.1.3-py2.7.egg ├── Bishop-2.1.4-py2.7.egg ├── Bishop-2.2.0-py2.7.egg ├── Bishop-2.2.1-py2.7.egg ├── Bishop-2.2.2-py2.7.egg ├── Bishop-2.3.0-py2.7.egg ├── Bishop-2.4.0-py2.7.egg ├── Bishop-2.4.1-py2.7.egg ├── Bishop-2.5.0-py2.7.egg ├── Bishop-2.5.1-py2.7.egg ├── Bishop-2.5.2-py2.7.egg ├── Bishop-2.5.3-py2.7.egg ├── Bishop-2.6.1-py2.7.egg ├── Bishop-2.6.2-py2.7.egg ├── Bishop-2.6.3-py2.7.egg ├── Bishop-2.6.3-py3.5.egg ├── Bishop-2.6.3-py3.8.egg ├── Bishop-0.1.0.5-py2.7.egg └── Bishop-0.1.0.6-py2.7.egg ├── .gitignore ├── MANIFEST.in ├── setup.py ├── MIT-license.txt ├── bin ├── Bishop └── BishopInference.py ├── ChangeLog.txt └── README.md /bishop.egg-info/not-zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /bishop.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /bishop.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | Bishop 2 | -------------------------------------------------------------------------------- /bishop.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | matplotlib 3 | scipy 4 | argparse 5 | Image 6 | -------------------------------------------------------------------------------- /Bishop/Fonts/estre.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/Bishop/Fonts/estre.ttf -------------------------------------------------------------------------------- /dist/Bishop-3-py3.8.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-3-py3.8.egg -------------------------------------------------------------------------------- /dist/Bishop-2.6-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.6-py2.7.egg -------------------------------------------------------------------------------- /Bishop/Maps/OneGoalExample/OneGoal_Example: -------------------------------------------------------------------------------- 1 | 00000 2 | 11100 3 | 01011 4 | 00000 5 | 6 | Terrain 7 | Obstacle -------------------------------------------------------------------------------- /Bishop/Maps/OneGoalExample/TwoGoal_Example: -------------------------------------------------------------------------------- 1 | 00000 2 | 11100 3 | 01011 4 | 00000 5 | 6 | Terrain 7 | Obstacle -------------------------------------------------------------------------------- /dist/Bishop-1.0.0-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-1.0.0-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.0.0-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.0.0-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.1.3-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.1.3-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.1.4-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.1.4-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.2.0-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.2.0-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.2.1-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.2.1-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.2.2-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.2.2-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.3.0-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.3.0-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.4.0-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.4.0-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.4.1-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.4.1-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.5.0-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.5.0-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.5.1-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.5.1-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.5.2-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.5.2-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.5.3-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.5.3-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.6.1-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.6.1-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.6.2-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.6.2-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.6.3-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.6.3-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-2.6.3-py3.5.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.6.3-py3.5.egg -------------------------------------------------------------------------------- /dist/Bishop-2.6.3-py3.8.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-2.6.3-py3.8.egg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore compiled code and egg metadata 2 | *.pyc 3 | /*.egg-info 4 | .DS_Store 5 | bin/.DS_Store 6 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps/Shore_Map: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0000000 3 | 1111111 4 | 1111111 5 | 6 | TopTerrain 7 | BottomTerrain -------------------------------------------------------------------------------- /dist/Bishop-0.1.0.5-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-0.1.0.5-py2.7.egg -------------------------------------------------------------------------------- /dist/Bishop-0.1.0.6-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianje/Bishop/HEAD/dist/Bishop-0.1.0.6-py2.7.egg -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/LongFlag_SymmetricB: -------------------------------------------------------------------------------- 1 | 11111110001111 2 | 11111110001111 3 | 11111110001111 4 | 5 | Center 6 | Left -------------------------------------------------------------------------------- /Bishop/Maps/BayesBookExampleMaps/CRInference_base: -------------------------------------------------------------------------------- 1 | 0000 2 | 0000 3 | 0110 4 | 0110 5 | 0000 6 | 7 | MainTerrain 8 | Grass -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorld: -------------------------------------------------------------------------------- 1 | 00000000000 2 | 00000001000 3 | 00100011100 4 | 01110111110 5 | 6 | Outside 7 | Inside -------------------------------------------------------------------------------- /Bishop/Maps/BayesBookExampleMaps/GoalInference_base: -------------------------------------------------------------------------------- 1 | 00000 2 | 11100 3 | 00000 4 | 01000 5 | 01000 6 | 7 | MainTerrain 8 | Walls -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/LongFlag_AsymmetricB: -------------------------------------------------------------------------------- 1 | 11111110002222 2 | 11111110002222 3 | 11111110002222 4 | 5 | Center 6 | Left 7 | Right -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | recursive-include Bishop/Maps * 3 | include Bishop/Examples/* 4 | include Bishop/Fonts/* 5 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMaps2Agents/Pond_OT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0000000 3 | 0000000 4 | 0000000 5 | 0000000 6 | 0000000 7 | 0000000 8 | 9 | Outside -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/Pond_OT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0000000 3 | 0000000 4 | 0000000 5 | 0000000 6 | 0000000 7 | 0000000 8 | 9 | Outside -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsTwoObjs/Pond_OT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0000000 3 | 0000000 4 | 0000000 5 | 0000000 6 | 0000000 7 | 0000000 8 | 9 | Outside -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/Pond_OT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0000000 3 | 0000000 4 | 0000000 5 | 0000000 6 | 0000000 7 | 0000000 8 | 9 | Outside -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/Pond_OT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0000000 3 | 0000000 4 | 0000000 5 | 0000000 6 | 0000000 7 | 0000000 8 | 9 | Outside -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps_Long/LongShore_Map: -------------------------------------------------------------------------------- 1 | 00000000000 2 | 00000000000 3 | 11111111111 4 | 11111111111 5 | 6 | TopTerrain 7 | BottomTerrain -------------------------------------------------------------------------------- /Bishop/Maps/PondMaps2Agents/Pond_TT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0001000 3 | 0011100 4 | 0111110 5 | 0011100 6 | 0001000 7 | 0000000 8 | 9 | Outside 10 | Inside -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsTwoObjs/Pond_TT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0001000 3 | 0011100 4 | 0111110 5 | 0011100 6 | 0001000 7 | 0000000 8 | 9 | Outside 10 | Inside -------------------------------------------------------------------------------- /Bishop/Maps/SimpleGoalMap/SimpleMap: -------------------------------------------------------------------------------- 1 | 0000100 2 | 0000100 3 | 0000100 4 | 0000100 5 | 0000000 6 | 0000000 7 | 0000000 8 | 9 | Outside 10 | Walls -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/Pond_TT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0001000 3 | 0011100 4 | 0111110 5 | 0011100 6 | 0001000 7 | 0000000 8 | 9 | Outside 10 | Inside -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/Pond_TT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0001000 3 | 0011100 4 | 0111110 5 | 0011100 6 | 0001000 7 | 0000000 8 | 9 | Outside 10 | Inside -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/Pond_TT: -------------------------------------------------------------------------------- 1 | 0000000 2 | 0001000 3 | 0011100 4 | 0111110 5 | 0011100 6 | 0001000 7 | 0000000 8 | 9 | Outside 10 | Inside -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorld_Large: -------------------------------------------------------------------------------- 1 | 000000000000000 2 | 000000000010000 3 | 000100000111000 4 | 001110001111100 5 | 011111011111110 6 | 7 | Outside 8 | Inside -------------------------------------------------------------------------------- /Bishop/Maps/HallwaysMaps/Hallways_base: -------------------------------------------------------------------------------- 1 | 0111000 2 | 0333000 3 | 0333000 4 | 0333000 5 | 0222000 6 | 7 | MainTerrain 8 | TopTerrain 9 | BottomTerrain 10 | Walls -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/LongFlag_Symmetric_FC: -------------------------------------------------------------------------------- 1 | 00000000000000000 2 | 00000000000000000 3 | 00000000000000000 4 | 00000000000000000 5 | 00000000000000000 6 | 7 | Center -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/LongFlag_Symmetric: -------------------------------------------------------------------------------- 1 | 11111110001111111 2 | 11111110001111111 3 | 11111110001111111 4 | 11111110001111111 5 | 11111110001111111 6 | 7 | Center 8 | Left -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/LongFlag_Symmetric: -------------------------------------------------------------------------------- 1 | 11111110001111111 2 | 11111110001111111 3 | 11111110001111111 4 | 11111110001111111 5 | 11111110001111111 6 | 7 | Center 8 | Left -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/LongFlag_Asymmetric: -------------------------------------------------------------------------------- 1 | 11111110002222222 2 | 11111110002222222 3 | 11111110002222222 4 | 11111110002222222 5 | 11111110002222222 6 | 7 | Center 8 | Left 9 | Right -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/LongFlag_Asymmetric: -------------------------------------------------------------------------------- 1 | 11111110002222222 2 | 11111110002222222 3 | 11111110002222222 4 | 11111110002222222 5 | 11111110002222222 6 | 7 | Center 8 | Left 9 | Right -------------------------------------------------------------------------------- /Bishop/Maps/RecombinationMaps/LongFlag_Asymmetric: -------------------------------------------------------------------------------- 1 | 11111110002222222 2 | 11111110002222222 3 | 11111110002222222 4 | 11111110002222222 5 | 11111110002222222 6 | 7 | Center 8 | Left 9 | Right -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Map: -------------------------------------------------------------------------------- 1 | 1111100022222 2 | 1111100022222 3 | 1111100022222 4 | 1111100022222 5 | 1111100022222 6 | 1111100022222 7 | 1111100022222 8 | 9 | Center 10 | Left 11 | Right -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_base_control: -------------------------------------------------------------------------------- 1 | 11111110001111111 2 | 11111110001111111 3 | 11111110001111111 4 | 11111110001111111 5 | 11111110001111111 6 | 7 | Center 8 | StaticTerrain -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_terrainleftuniform: -------------------------------------------------------------------------------- 1 | 11111110001111111 2 | 11111110001111111 3 | 11111110001111111 4 | 11111110001111111 5 | 11111110001111111 6 | 7 | Center 8 | LeftOriginal -------------------------------------------------------------------------------- /Bishop/Maps/RecombinationMaps/Recomb_base: -------------------------------------------------------------------------------- 1 | 11111110002222222 2 | 11111110002222222 3 | 11111110002222222 4 | 11111110002222222 5 | 11111110002222222 6 | 7 | Center 8 | LeftOriginal 9 | RightOriginal -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_base: -------------------------------------------------------------------------------- 1 | 11111110002222222 2 | 11111110002222222 3 | 11111110002222222 4 | 11111110002222222 5 | 11111110002222222 6 | 7 | Center 8 | LeftOriginal 9 | RightOriginal -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_terrainrightuniform: -------------------------------------------------------------------------------- 1 | 11111110001111111 2 | 11111110001111111 3 | 11111110001111111 4 | 11111110001111111 5 | 11111110001111111 6 | 7 | Center 8 | RightOriginal -------------------------------------------------------------------------------- /Bishop/Maps/RecombinationMaps/Recomb_inverse: -------------------------------------------------------------------------------- 1 | 22222220001111111 2 | 22222220001111111 3 | 22222220001111111 4 | 22222220001111111 5 | 22222220001111111 6 | 7 | Center 8 | LeftOriginal 9 | RightOriginal -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_terrainflip: -------------------------------------------------------------------------------- 1 | 22222220001111111 2 | 22222220001111111 3 | 22222220001111111 4 | 22222220001111111 5 | 22222220001111111 6 | 7 | Center 8 | LeftOriginal 9 | RightOriginal -------------------------------------------------------------------------------- /Bishop/__init__.py: -------------------------------------------------------------------------------- 1 | from .MDP import * 2 | from .Agent import * 3 | from .Map import * 4 | from .Planner import * 5 | from .Observer import * 6 | from .AuxiliaryFunctions import * 7 | from .PosteriorContainer import * 8 | from .AgentSimulation import * 9 | -------------------------------------------------------------------------------- /Bishop/Examples/SimpleInference.py: -------------------------------------------------------------------------------- 1 | # Bishop inference 2 | 3 | from Bishop import * 4 | 5 | Observer = LoadObserver("Tatik_T1_L1") 6 | # When Feedback is True function prints percentage complete 7 | Res = Observer.InferAgent( 8 | ActionSequence=['R', 'R'], Samples=500, Feedback=True) 9 | Res.Summary() 10 | -------------------------------------------------------------------------------- /Bishop/Maps/OneGoalExample/OneGoal_Example.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: OneGoal_Example 4 | StartingPoint: 0 5 | ExitState: 19 6 | 7 | [Objects] 8 | ObjectLocations: 19 9 | ObjectTypes: 0 10 | ObjectNames: FinalGoal 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 1 22 | CostParameters = 1 23 | RewardParameters = 10 24 | -------------------------------------------------------------------------------- /Bishop/Maps/OneGoalExample/TwoGoal_Exampley.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: OneGoal_Example 4 | StartingPoint: 0 5 | ExitState: 19 6 | 7 | [Objects] 8 | ObjectLocations: 19 9 | ObjectTypes: 0 10 | ObjectNames: FinalGoal 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 1 22 | CostParameters = 1 23 | RewardParameters = 10 24 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_OT_ORC_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 24 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | CostParameters = 5 23 | RewardParameters = 15 24 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_OT_ORE_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | CostParameters = 5 23 | RewardParameters = 15 24 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_TT_ORC_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 24 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | CostParameters = 5 23 | RewardParameters = 15 24 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_TT_ORE_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | CostParameters = 5 23 | RewardParameters = 15 24 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_OT_TRC_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | CostParameters = 5 23 | RewardParameters = 15 24 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_OT_TRE_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | CostParameters = 5 23 | RewardParameters = 15 24 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_TT_TRC_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | CostParameters = 5 23 | RewardParameters = 15 24 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_TT_TRE_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: Constant 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = True 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | CostParameters = 5 23 | RewardParameters = 15 24 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_OT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 27 9 | ObjectTypes: 0 10 | ObjectNames: Exit 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_TT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 27 9 | ObjectTypes: 0 10 | ObjectNames: Exit 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_OT_ORC_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 24 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 7.5 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_OT_ORE_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 7.5 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_TT_ORC_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 24 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 7.5 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_TT_ORE_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 7.5 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_OT_ORC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 24 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_OT_ORE.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_TT_ORC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 24 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_TT_ORE.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: TopTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/SimpleGoalMap/SimpleGoalMap.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: False 3 | MapName: SimpleMap 4 | StartingPoint: 0 5 | ExitState: 10 6 | 7 | [Objects] 8 | ObjectLocations: 5 9 | ObjectTypes: 0 10 | ObjectNames: Target 11 | Organic: 0 12 | 13 | [AgentParameters] 14 | Method: Linear 15 | CostPrior: Constant 16 | RewardPrior: ScaledUniform 17 | Restrict: False 18 | Minimum: 1 19 | Capacity: 1 20 | SoftmaxAction = True 21 | RNull = 0 22 | CNull = 0 23 | actionTau = 0.1 24 | CostParameters = 1 500 25 | RewardParameters = 30 26 | -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorld_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: MoralWorld 4 | StartingPoint: 33 5 | ExitState: 43 6 | 7 | [Objects] 8 | ObjectLocations: 35 9 | ObjectTypes: 0 10 | ObjectNames: LostAstronaut 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 50 25 | -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorld_FE.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: MoralWorld 4 | StartingPoint: 33 5 | ExitState: 43 6 | 7 | [Objects] 8 | ObjectLocations: 13 9 | ObjectTypes: 0 10 | ObjectNames: LostAstronaut 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 50 25 | -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorld_SC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: MoralWorld 4 | StartingPoint: 33 5 | ExitState: 43 6 | 7 | [Objects] 8 | ObjectLocations: 40 9 | ObjectTypes: 0 10 | ObjectNames: LostAstronaut 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 50 25 | -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorld_SE.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: MoralWorld 4 | StartingPoint: 33 5 | ExitState: 43 6 | 7 | [Objects] 8 | ObjectLocations: 7 9 | ObjectTypes: 0 10 | ObjectNames: LostAstronaut 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 50 25 | -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorldLarge_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: MoralWorld_Large 4 | StartingPoint: 60 5 | ExitState: 74 6 | 7 | [Objects] 8 | ObjectLocations: 63 9 | ObjectTypes: 0 10 | ObjectNames: LostAstronaut 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 50 25 | -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorldLarge_FE.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: MoralWorld_Large 4 | StartingPoint: 60 5 | ExitState: 74 6 | 7 | [Objects] 8 | ObjectLocations: 18 9 | ObjectTypes: 0 10 | ObjectNames: LostAstronaut 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 50 25 | -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorldLarge_SC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: MoralWorld_Large 4 | StartingPoint: 60 5 | ExitState: 74 6 | 7 | [Objects] 8 | ObjectLocations: 70 9 | ObjectTypes: 0 10 | ObjectNames: LostAstronaut 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 50 25 | -------------------------------------------------------------------------------- /Bishop/Maps/MoralWorld/MoralWorldLarge_SE.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: MoralWorld_Large 4 | StartingPoint: 60 5 | ExitState: 74 6 | 7 | [Objects] 8 | ObjectLocations: 10 9 | ObjectTypes: 0 10 | ObjectNames: LostAstronaut 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 50 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_OT_TRC_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 7.5 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_OT_TRE_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 7.5 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_TT_TRC_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 7.5 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondAlternativeModels/P_TT_TRE_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: Constant 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = True 19 | RNull = 0 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 7.5 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_OT_TRC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_OT_TRE.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_TT_TRE.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = True 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsOneObjCap/P_TT_TRC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Capacity: 1 17 | SoftmaxChoice = False 18 | SoftmaxAction = False 19 | RNull = 0.2 20 | CNull = 0 21 | actionTau = 0.01 22 | choiceTau = 0.01 23 | CostParameters = 10 24 | RewardParameters = 30 25 | -------------------------------------------------------------------------------- /Bishop/Maps/BayesBookExampleMaps/CRInference_base.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: False 3 | MapName: CRInference_base 4 | StartingPoint: 12 5 | ExitState: 19 6 | 7 | [Objects] 8 | ObjectLocations: 0 7 9 | ObjectTypes: 0 1 10 | ObjectNames: TopLeft RightObject 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | SoftmaxChoice = True 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.01 20 | actionTau = 0.01 21 | Minimum: 1 22 | Capacity: 1 23 | CostParameters = 1 24 | RewardParameters = 1 25 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsTwoObjs/P_OT_TRC_2Ob.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Minimum: 0 17 | Capacity: 2 18 | SoftmaxChoice = False 19 | SoftmaxAction = False 20 | RNull = 0.1 21 | CNull = 0 22 | actionTau = 0.01 23 | choiceTau = 0.01 24 | CostParameters = 10 25 | RewardParameters = 30 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsTwoObjs/P_OT_TRE_2Ob.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Minimum: 0 17 | Capacity: 2 18 | SoftmaxChoice = False 19 | SoftmaxAction = False 20 | RNull = 0.1 21 | CNull = 0 22 | actionTau = 0.01 23 | choiceTau = 0.01 24 | CostParameters = 10 25 | RewardParameters = 30 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsTwoObjs/P_TT_TRC_2Ob.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Minimum: 0 17 | Capacity: 2 18 | SoftmaxChoice = False 19 | SoftmaxAction = False 20 | RNull = 0.1 21 | CNull = 0 22 | actionTau = 0.01 23 | choiceTau = 0.01 24 | CostParameters = 10 25 | RewardParameters = 30 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsTwoObjs/P_TT_TRE_2Ob.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: TopTreat BottomTreat 11 | 12 | [AgentParameters] 13 | CostPrior: ScaledUniform 14 | RewardPrior: ScaledUniform 15 | Restrict: False 16 | Minimum: 0 17 | Capacity: 2 18 | SoftmaxChoice = False 19 | SoftmaxAction = False 20 | RNull = 0.1 21 | CNull = 0 22 | actionTau = 0.01 23 | choiceTau = 0.01 24 | CostParameters = 10 25 | RewardParameters = 30 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Asym_OneR_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric_FC 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: Constant 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Asym_OneR_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: Constant 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 50 -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Sym_OneR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Asym_OneR_Dist_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric_FC 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: Constant 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Asym_TwoR_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: Constant 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 50 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Sym_TwoR_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: Constant 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 50 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_OneR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_OneRB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_AsymmetricB 4 | # Starting point will get overriden later 5 | StartingPoint: 22 6 | ExitState: 36 7 | 8 | [Objects] 9 | ObjectLocations: 17 27 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Sym_OneRB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_SymmetricB 4 | # Starting point will get overriden later 5 | StartingPoint: 22 6 | ExitState: 36 7 | 8 | [Objects] 9 | ObjectLocations: 17 27 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Sym_OneR_Dist.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Asym_OneR_Dist_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: Constant 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 50 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Asym_TwoR_Dist_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: Constant 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 50 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Asym_TwoR_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric_FC 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: Constant 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Sym_TwoR_Dist_FR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: Constant 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 50 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Sym_TwoR_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric_FC 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: Constant 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_OneR_Dist.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_OneR_DistB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_AsymmetricB 4 | # Starting point will get overriden later 5 | StartingPoint: 22 6 | ExitState: 36 7 | 8 | [Objects] 9 | ObjectLocations: 14 25 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_TwoR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Sym_OneR_DistB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_SymmetricB 4 | # Starting point will get overriden later 5 | StartingPoint: 22 6 | ExitState: 36 7 | 8 | [Objects] 9 | ObjectLocations: 14 25 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Sym_TwoR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 37 47 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Sym_TwoRB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_SymmetricB 4 | # Starting point will get overriden later 5 | StartingPoint: 22 6 | ExitState: 36 7 | 8 | [Objects] 9 | ObjectLocations: 17 27 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Asym_TwoR_Dist_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric_FC 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: Constant 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ControlFlagMaps/Flag_Sym_TwoR_Dist_FC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric_FC 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: Constant 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = False 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_TwoRB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_AsymmetricB 4 | # Starting point will get overriden later 5 | StartingPoint: 22 6 | ExitState: 36 7 | 8 | [Objects] 9 | ObjectLocations: 17 27 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_TwoR_Dist.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Sym_TwoR_Dist.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Symmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Sym_TwoR_DistB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_SymmetricB 4 | # Starting point will get overriden later 5 | StartingPoint: 22 6 | ExitState: 36 7 | 8 | [Objects] 9 | ObjectLocations: 14 25 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_TwoR_DistB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_AsymmetricB 4 | # Starting point will get overriden later 5 | StartingPoint: 22 6 | ExitState: 36 7 | 8 | [Objects] 9 | ObjectLocations: 14 25 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_TwoR_DistInv.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/FlagMaps/Flag_Asym_TwoR_InvertedR.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: LongFlag_Asymmetric 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 47 37 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMaps2Agents/P_Org_OT_ORE_2Ag.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: AstronautA 11 | Organic: 1 12 | SurvivalProb: 0.95 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.01 27 | CostParameters = 10 28 | RewardParameters = 30 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMaps2Agents/P_Org_TT_ORE_2Ag.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: AstronautA 11 | Organic: 1 12 | SurvivalProb: 0.95 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.01 27 | CostParameters = 10 28 | RewardParameters = 30 29 | -------------------------------------------------------------------------------- /Bishop/Maps/RecombinationMaps/Recomb_TerrainFlip.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Recomb_inverse 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMaps2Agents/P_Org_TT_ORC_2Ag.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 24 9 | ObjectTypes: 0 10 | ObjectNames: AstronautA 11 | Organic: 1 12 | SurvivalProb: 0.95 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.01 27 | CostParameters = 10 28 | RewardParameters = 30 29 | -------------------------------------------------------------------------------- /Bishop/Maps/RecombinationMaps/Recomb_TerrainRewardFlip.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Recomb_inverse 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 10 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_OT_ORT_1Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: StrandedAstronaut 11 | Organic: 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_TT_ORC_1Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: StrandedAstronaut 11 | Organic: 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RFlip_TFlip.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainflip 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RKeep_TFlip.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainflip 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 0 -1 -1 25 | RewardParameters = 100 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_OT_ORT_1Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: StrandedAstronaut 11 | Organic: 1 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_TT_ORC_1Ob_AC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 24 9 | ObjectTypes: 0 10 | ObjectNames: StrandedAstronaut 11 | Organic: 1 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_TT_ORC_1Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 9 | ObjectTypes: 0 10 | ObjectNames: StrandedAstronaut 11 | Organic: 1 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_TT_ORC_1Ob_AC.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 24 9 | ObjectTypes: 0 10 | ObjectNames: StrandedAstronaut 11 | Organic: 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/RecombinationMaps/Recomb_RewardFlip.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Recomb_base 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | choiceTau = 0.1 25 | CostParameters = 10 0 -1 -1 26 | RewardParameters = 100 27 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMaps2Agents/P_Org_OT_TRC_2Ag.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: AstronautA AstronautB 11 | Organic: 1 1 12 | SurvivalProb: 0.95 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.01 27 | CostParameters = 10 28 | RewardParameters = 30 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMaps2Agents/P_Org_OT_TRE_2Ag.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: AstronautA AstronautB 11 | Organic: 1 1 12 | SurvivalProb: 0.95 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.01 27 | CostParameters = 10 28 | RewardParameters = 30 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMaps2Agents/P_Org_TT_TRC_2Ag.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: AstronautA AstronautB 11 | Organic: 1 1 12 | SurvivalProb: 0.95 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.01 27 | CostParameters = 10 28 | RewardParameters = 30 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMaps2Agents/P_Org_TT_TRE_2Ag.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: AstronautA AstronautB 11 | Organic: 1 1 12 | SurvivalProb: 0.95 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.01 27 | CostParameters = 10 28 | RewardParameters = 30 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RFlip_TFlip_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 0 1 25 | RewardParameters = 80 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RKeep_TFlip_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = False 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | CostParameters = 5 0 1 25 | RewardParameters = 80 26 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_OT_TRC_2Ob_AB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: Object StrandedAstronaut 11 | Organic: 0 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_OT_TRC_2Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: StrandedAstronaut Object 11 | Organic: 0 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_OT_TRE_2Ob_AB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: Object StrandedAstronaut 11 | Organic: 0 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_OT_TRE_2Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: StrandedAstronaut Object 11 | Organic: 0 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_TT_TRC_2Ob_AB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: Object StrandedAstronaut 11 | Organic: 0 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_TT_TRC_2Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: StrandedAstronaut Object 11 | Organic: 0 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_TT_TRE_2Ob_AB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: Object StrandedAstronaut 11 | Organic: 0 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_TT_TRE_2Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: StrandedAstronaut Object 11 | Organic: 0 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RFlip_TKeep.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | choiceTau = 0.1 25 | CostParameters = 5 0 -1 -1 26 | RewardParameters = 100 27 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_OT_TRC_2Ob_AB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: Object StrandedAstronaut 11 | Organic: 0 1 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_OT_TRC_2Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: StrandedAstronaut Object 11 | Organic: 1 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_OT_TRE_2Ob_AB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: Object StrandedAstronaut 11 | Organic: 0 1 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_OT_TRE_2Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_OT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: StrandedAstronaut Object 11 | Organic: 1 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_TT_TRC_2Ob_AB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: Object StrandedAstronaut 11 | Organic: 0 1 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_TT_TRC_2Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 24 9 | ObjectTypes: 0 1 10 | ObjectNames: StrandedAstronaut Object 11 | Organic: 1 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_TT_TRE_2Ob_AB.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: Object StrandedAstronaut 11 | Organic: 0 1 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PondMapsObjectAgent/P_Org_TT_TRE_2Ob_AT.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Pond_TT 4 | StartingPoint: 21 5 | ExitState: 27 6 | 7 | [Objects] 8 | ObjectLocations: 3 45 9 | ObjectTypes: 0 1 10 | ObjectNames: StrandedAstronaut Object 11 | Organic: 1 0 12 | SurvivalProb: 0.8 13 | 14 | [AgentParameters] 15 | Method: Linear 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 2 21 | SoftmaxChoice = True 22 | SoftmaxAction = False 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | choiceTau = 0.1 27 | CostParameters = 10 28 | RewardParameters = 60 29 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RFlip_TKeep_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | choiceTau = 0.1 25 | CostParameters = 5 0 1 26 | RewardParameters = 80 27 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RFlip_TLeft_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | choiceTau = 0.1 25 | CostParameters = 5 0 1 26 | RewardParameters = 80 27 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RFlip_TRight_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | choiceTau = 0.1 25 | CostParameters = 5 0 1 26 | RewardParameters = 80 27 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RFlip_TLeft.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainleftuniform 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | choiceTau = 0.1 25 | CostParameters = 5 0 -1 -1 26 | RewardParameters = 100 27 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RFlip_TRight.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainrightuniform 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 45 34 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | actionTau = 0.01 24 | choiceTau = 0.1 25 | CostParameters = 5 0 -1 -1 26 | RewardParameters = 100 27 | -------------------------------------------------------------------------------- /Bishop/Maps/HallwaysMaps/Hallways_base.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Hallways_base 4 | StartingPoint: 14 5 | ExitState: 20 6 | 7 | [Objects] 8 | ObjectLocations: 5 33 9 | ObjectTypes: 0 1 10 | ObjectNames: RedTreat YellowTreat 11 | 12 | [AgentParameters] 13 | CostPrior: PartialUniform 14 | RewardPrior: ScaledUniform 15 | SoftmaxChoice = True 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.1 20 | actionTau = 1 21 | Minimum: 1 22 | Capacity: 1 23 | # Costs are uniform from 0 to 10. 24 | # But terrain 0 always has cost 0, 25 | # and terrain 3 always has cost 500 26 | CostParameters = 40 0.01 -1 -1 500 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/HallwaysMaps/Hallways_CK_RI.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Hallways_base 4 | StartingPoint: 14 5 | ExitState: 20 6 | 7 | [Objects] 8 | ObjectLocations: 5 33 9 | ObjectTypes: 0 1 10 | ObjectNames: RedTreat YellowTreat 11 | 12 | [AgentParameters] 13 | CostPrior: PartialUniform 14 | RewardPrior: Gaussian 15 | SoftmaxChoice = False 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.05 20 | actionTau = 0.5 21 | Minimum: 1 22 | Capacity: 1 23 | # Costs are uniform from 0 to 10. 24 | # But terrain 0 always has cost 0, 25 | # and terrain 3 always has cost 500 26 | CostParameters = 40 0.5 -1 -1 500 27 | RewardParameters = 40 2 28 | -------------------------------------------------------------------------------- /Bishop/Maps/HallwaysMaps/Hallways_CK_RK.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Hallways_base 4 | StartingPoint: 14 5 | ExitState: 20 6 | 7 | [Objects] 8 | ObjectLocations: 5 33 9 | ObjectTypes: 0 1 10 | ObjectNames: RedTreat YellowTreat 11 | 12 | [AgentParameters] 13 | CostPrior: PartialUniform 14 | RewardPrior: ScaledUniform 15 | SoftmaxChoice = False 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.05 20 | actionTau = 0.5 21 | Minimum: 1 22 | Capacity: 1 23 | # Costs are uniform from 0 to 10. 24 | # But terrain 0 always has cost 0, 25 | # and terrain 3 always has cost 500 26 | CostParameters = 40 0.5 -1 -1 500 27 | RewardParameters = 80 28 | -------------------------------------------------------------------------------- /Bishop/Maps/HallwaysMaps/Hallways_CI_RI.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Hallways_base 4 | StartingPoint: 14 5 | ExitState: 20 6 | 7 | [Objects] 8 | ObjectLocations: 5 33 9 | ObjectTypes: 0 1 10 | ObjectNames: RedTreat YellowTreat 11 | 12 | [AgentParameters] 13 | CostPrior: PartialGaussian 14 | RewardPrior: Gaussian 15 | SoftmaxChoice = False 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.05 20 | actionTau = 0.5 21 | Minimum: 1 22 | Capacity: 1 23 | # Costs are uniform from 0 to 10. 24 | # But terrain 0 always has cost 0, 25 | # and terrain 3 always has cost 500 26 | CostParameters = 20 7.5 0.5 -1 -1 500 27 | RewardParameters = 40 2 28 | -------------------------------------------------------------------------------- /Bishop/Maps/HallwaysMaps/Hallways_CI_RK.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Hallways_base 4 | StartingPoint: 14 5 | ExitState: 20 6 | 7 | [Objects] 8 | ObjectLocations: 5 33 9 | ObjectTypes: 0 1 10 | ObjectNames: RedTreat YellowTreat 11 | 12 | [AgentParameters] 13 | CostPrior: PartialGaussian 14 | RewardPrior: ScaledUniform 15 | SoftmaxChoice = False 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.05 20 | actionTau = 0.5 21 | Minimum: 1 22 | Capacity: 1 23 | # Costs are uniform from 0 to 10. 24 | # But terrain 0 always has cost 0, 25 | # and terrain 3 always has cost 500 26 | CostParameters = 20 7.5 0.5 -1 -1 500 27 | RewardParameters = 80 28 | -------------------------------------------------------------------------------- /Bishop/Maps/HallwaysMaps/Hallways_base_prior.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Hallways_base 4 | StartingPoint: 14 5 | ExitState: 20 6 | 7 | [Objects] 8 | ObjectLocations: 5 33 9 | ObjectTypes: 0 1 10 | ObjectNames: RedTreat YellowTreat 11 | 12 | [AgentParameters] 13 | CostPrior: PartialGaussian 14 | RewardPrior: Gaussian 15 | SoftmaxChoice = True 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.1 20 | actionTau = 1 21 | Minimum: 1 22 | Capacity: 1 23 | # Costs are uniform from 0 to 10. 24 | # But terrain 0 always has cost 0, 25 | # and terrain 3 always has cost 500 26 | CostParameters = 20 0.5 0.01 -1 -1 500 27 | RewardParameters = 25 0.5 28 | -------------------------------------------------------------------------------- /Bishop/Maps/HallwaysMaps/Hallways_invRewards.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Hallways_base 4 | StartingPoint: 14 5 | ExitState: 20 6 | 7 | [Objects] 8 | ObjectLocations: 33 5 9 | ObjectTypes: 0 1 10 | ObjectNames: RedTreat YellowTreat 11 | 12 | [AgentParameters] 13 | CostPrior: PartialUniform 14 | RewardPrior: ScaledUniform 15 | SoftmaxChoice = False 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.1 20 | actionTau = 1 21 | Minimum: 1 22 | Capacity: 1 23 | # Costs are uniform from 0 to 10. 24 | # But terrain 0 always has cost 0, 25 | # and terrain 3 always has cost 500 26 | CostParameters = 40 0.01 -1 -1 500 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/HallwaysMaps/Hallways_inv_CK_RK.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Hallways_base 4 | StartingPoint: 14 5 | ExitState: 20 6 | 7 | [Objects] 8 | ObjectLocations: 33 5 9 | ObjectTypes: 0 1 10 | ObjectNames: RedTreat YellowTreat 11 | 12 | [AgentParameters] 13 | CostPrior: PartialUniform 14 | RewardPrior: ScaledUniform 15 | SoftmaxChoice = False 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.05 20 | actionTau = 0.5 21 | Minimum: 1 22 | Capacity: 1 23 | # Costs are uniform from 0 to 10. 24 | # But terrain 0 always has cost 0, 25 | # and terrain 3 always has cost 500 26 | CostParameters = 40 0.5 -1 -1 500 27 | RewardParameters = 80 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps/Shore_RO_EO.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: Shore_Map 7 | StartingPoint: 14 8 | ExitState: 13 9 | 10 | [Objects] 11 | ObjectLocations: 10 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps/Shore_RO_ES.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: Shore_Map 7 | StartingPoint: 14 8 | ExitState: 20 9 | 10 | [Objects] 11 | ObjectLocations: 10 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps/Shore_RS_EO.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: Shore_Map 7 | StartingPoint: 14 8 | ExitState: 13 9 | 10 | [Objects] 11 | ObjectLocations: 17 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps/Shore_RS_ES.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: Shore_Map 7 | StartingPoint: 14 8 | ExitState: 20 9 | 10 | [Objects] 11 | ObjectLocations: 17 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps_Long/LongShore_ROF.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: LongShore_Map 7 | StartingPoint: 22 8 | ExitState: 21 9 | 10 | [Objects] 11 | ObjectLocations: 5 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | 4 | def readme(): 5 | with open('README.md') as f: 6 | return f.read() 7 | 8 | setup(name='Bishop', 9 | version='3', 10 | description='Cognitive model of Theory of Mind', 11 | long_description=readme(), 12 | url='http://gibthub.com/julianje/bishop', 13 | author='Julian Jara-Ettinger', 14 | license='MIT', 15 | packages=['Bishop'], 16 | scripts=['bin/Bishop'], 17 | install_requires=[ 18 | 'numpy', 19 | 'matplotlib', 20 | 'scipy', 21 | 'argparse', 22 | 'Image' 23 | ], 24 | include_package_data=True, 25 | zip_safe=False) 26 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps_Long/LongShore_ROC.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: LongShore_Map 7 | StartingPoint: 22 8 | ExitState: 21 9 | 10 | [Objects] 11 | ObjectLocations: 16 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps_Long/LongShore_RO_EO.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: LongShore_Map 7 | StartingPoint: 22 8 | ExitState: 21 9 | 10 | [Objects] 11 | ObjectLocations: 5 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps_Long/LongShore_RO_ES.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: LongShore_Map 7 | StartingPoint: 22 8 | ExitState: 32 9 | 10 | [Objects] 11 | ObjectLocations: 5 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps_Long/LongShore_RSC.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: LongShore_Map 7 | StartingPoint: 22 8 | ExitState: 21 9 | 10 | [Objects] 11 | ObjectLocations: 27 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps_Long/LongShore_RSF.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: LongShore_Map 7 | StartingPoint: 22 8 | ExitState: 21 9 | 10 | [Objects] 11 | ObjectLocations: 38 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps_Long/LongShore_RS_EO.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: LongShore_Map 7 | StartingPoint: 22 8 | ExitState: 21 9 | 10 | [Objects] 11 | ObjectLocations: 38 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/ShoreMaps_Long/LongShore_RS_ES.ini: -------------------------------------------------------------------------------- 1 | # [RS,RO] refers to whether the reward is on the 2 | # same side that the agent is RS or on the other terrain. 3 | # [ES, EO] is the same but for the exit state 4 | [MapParameters] 5 | DiagonalTravel: True 6 | MapName: LongShore_Map 7 | StartingPoint: 22 8 | ExitState: 32 9 | 10 | [Objects] 11 | ObjectLocations: 38 12 | ObjectTypes: 0 13 | ObjectNames: Treat 14 | 15 | [AgentParameters] 16 | CostPrior: ScaledUniform 17 | RewardPrior: ScaledUniform 18 | Restrict: False 19 | Minimum: 0 20 | Capacity: 1 21 | SoftmaxChoice = False 22 | SoftmaxAction = True 23 | RNull = 0.2 24 | CNull = 0 25 | actionTau = 0.01 26 | CostParameters = 10 27 | RewardParameters = 50 28 | -------------------------------------------------------------------------------- /Bishop/Maps/RecombinationMaps/Recomb_base.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Recomb_base 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 10 0 -1 -1 29 | RewardParameters = 100 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_base.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 -1 -1 29 | RewardParameters = 100 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RKeep_TKeep.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 -1 -1 29 | RewardParameters = 100 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RLeft_TLeft_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 1 29 | RewardParameters = 80 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RLeft_TRight_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 1 29 | RewardParameters = 80 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RRight_TLeft_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 1 29 | RewardParameters = 80 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RRight_TRight_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 1 29 | RewardParameters = 80 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_base_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 1 29 | RewardParameters = 80 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RLeft_TLeft.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainleftuniform 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 -1 -1 29 | RewardParameters = 100 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RLeft_TRight.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainrightuniform 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: LTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 -1 -1 29 | RewardParameters = 100 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RRight_TLeft.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainleftuniform 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 -1 -1 29 | RewardParameters = 100 30 | -------------------------------------------------------------------------------- /Bishop/Maps/BayesBookExampleMaps/GoalInference_base.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: False 3 | MapName: GoalInference_base 4 | StartingPoint: 20 5 | ExitState: 4 6 | 7 | [Objects] 8 | ObjectLocations: 0 24 9 | ObjectTypes: 0 1 10 | ObjectNames: TopLeft BottomRight 11 | 12 | [AgentParameters] 13 | CostPrior: PartialUniform 14 | RewardPrior: ScaledUniform 15 | SoftmaxChoice = True 16 | SoftmaxAction = True 17 | RNull = 0 18 | CNull = 0 19 | choiceTau = 0.01 20 | actionTau = 0.01 21 | Minimum: 1 22 | Capacity: 1 23 | # In a partial uniform distribution 24 | # The first parameter indicates the range of costs 25 | # Followed by a list of length equal to the 26 | # number of terrains. Positive numbers means costs 27 | # are fixed. -1 means those values are inferred. 28 | CostParameters = 1 0.001 500 29 | RewardParameters = 1 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RKeep_TKeep_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 1 29 | RewardParameters = 80 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RKeep_TLeft_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 1 29 | RewardParameters = 80 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RKeep_TLeft.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainleftuniform 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 -1 -1 29 | RewardParameters = 100 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RRight_TRight.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainrightuniform 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 0 11 | ObjectNames: RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 -1 -1 29 | RewardParameters = 100 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RKeep_TRight_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 1 29 | RewardParameters = 80 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RKeep_TRight.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainrightuniform 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | ObjectLocations: 34 45 10 | ObjectTypes: 0 1 11 | ObjectNames: LTreat RTreat 12 | 13 | [AgentParameters] 14 | CostPrior: PartialUniform 15 | RewardPrior: ScaledUniform 16 | Restrict: False 17 | Minimum: 1 18 | Capacity: 1 19 | SoftmaxChoice = True 20 | SoftmaxAction = True 21 | RNull = 0.2 22 | CNull = 0 23 | choiceTau = 0.1 24 | actionTau = 0.01 25 | # First parameter notes the cost range. Next there is 26 | # one parameter per terrain where -1 means it's variable, 27 | # and any other number indicates that constant cost 28 | CostParameters = 5 0 -1 -1 29 | RewardParameters = 100 30 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RLeft_TKeep.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | # This map constrats with Prediction_base.ini making all rewards of the kind on the right. 10 | ObjectLocations: 34 45 11 | ObjectTypes: 0 0 12 | ObjectNames: LTreat 13 | 14 | [AgentParameters] 15 | CostPrior: PartialUniform 16 | RewardPrior: ScaledUniform 17 | Restrict: False 18 | Minimum: 1 19 | Capacity: 1 20 | SoftmaxChoice = True 21 | SoftmaxAction = True 22 | RNull = 0.2 23 | CNull = 0 24 | choiceTau = 0.1 25 | actionTau = 0.01 26 | # First parameter notes the cost range. Next there is 27 | # one parameter per terrain where -1 means it's variable, 28 | # and any other number indicates that constant cost 29 | CostParameters = 5 0 -1 -1 30 | RewardParameters = 100 31 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RRight_TKeep.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | # This map constrats with Prediction_base.ini making all rewards of the kind on the right. 10 | ObjectLocations: 34 45 11 | ObjectTypes: 0 0 12 | ObjectNames: RTreat 13 | 14 | [AgentParameters] 15 | CostPrior: PartialUniform 16 | RewardPrior: ScaledUniform 17 | Restrict: False 18 | Minimum: 1 19 | Capacity: 1 20 | SoftmaxChoice = True 21 | SoftmaxAction = True 22 | RNull = 0.2 23 | CNull = 0 24 | choiceTau = 0.1 25 | actionTau = 0.01 26 | # First parameter notes the cost range. Next there is 27 | # one parameter per terrain where -1 means it's variable, 28 | # and any other number indicates that constant cost 29 | CostParameters = 5 0 -1 -1 30 | RewardParameters = 100 31 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RLeft_TFlip.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainflip 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | # This map constrats with Prediction_base.ini making all rewards of the kind on the right. 10 | ObjectLocations: 34 45 11 | ObjectTypes: 0 0 12 | ObjectNames: LTreat 13 | 14 | [AgentParameters] 15 | CostPrior: PartialUniform 16 | RewardPrior: ScaledUniform 17 | Restrict: False 18 | Minimum: 1 19 | Capacity: 1 20 | SoftmaxChoice = True 21 | SoftmaxAction = True 22 | RNull = 0.2 23 | CNull = 0 24 | choiceTau = 0.1 25 | actionTau = 0.01 26 | # First parameter notes the cost range. Next there is 27 | # one parameter per terrain where -1 means it's variable, 28 | # and any other number indicates that constant cost 29 | CostParameters = 5 0 -1 -1 30 | RewardParameters = 100 31 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionTaskMaps/Prediction_RRight_TFlip.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_terrainflip 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | # This map constrats with Prediction_base.ini making all rewards of the kind on the right. 10 | ObjectLocations: 34 45 11 | ObjectTypes: 0 0 12 | ObjectNames: RTreat 13 | 14 | [AgentParameters] 15 | CostPrior: PartialUniform 16 | RewardPrior: ScaledUniform 17 | Restrict: False 18 | Minimum: 1 19 | Capacity: 1 20 | SoftmaxChoice = True 21 | SoftmaxAction = True 22 | RNull = 0.2 23 | CNull = 0 24 | choiceTau = 0.1 25 | actionTau = 0.01 26 | # First parameter notes the cost range. Next there is 27 | # one parameter per terrain where -1 means it's variable, 28 | # and any other number indicates that constant cost 29 | CostParameters = 5 0 -1 -1 30 | RewardParameters = 100 31 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RLeft_TFlip_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | # This map constrats with Prediction_base.ini making all rewards of the kind on the right. 10 | ObjectLocations: 34 45 11 | ObjectTypes: 0 0 12 | ObjectNames: LTreat 13 | 14 | [AgentParameters] 15 | CostPrior: PartialUniform 16 | RewardPrior: ScaledUniform 17 | Restrict: False 18 | Minimum: 1 19 | Capacity: 1 20 | SoftmaxChoice = True 21 | SoftmaxAction = True 22 | RNull = 0.2 23 | CNull = 0 24 | choiceTau = 0.1 25 | actionTau = 0.01 26 | # First parameter notes the cost range. Next there is 27 | # one parameter per terrain where -1 means it's variable, 28 | # and any other number indicates that constant cost 29 | CostParameters = 5 0 1 30 | RewardParameters = 80 31 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RLeft_TKeep_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | # This map constrats with Prediction_base.ini making all rewards of the kind on the right. 10 | ObjectLocations: 34 45 11 | ObjectTypes: 0 0 12 | ObjectNames: LTreat 13 | 14 | [AgentParameters] 15 | CostPrior: PartialUniform 16 | RewardPrior: ScaledUniform 17 | Restrict: False 18 | Minimum: 1 19 | Capacity: 1 20 | SoftmaxChoice = True 21 | SoftmaxAction = True 22 | RNull = 0.2 23 | CNull = 0 24 | choiceTau = 0.1 25 | actionTau = 0.01 26 | # First parameter notes the cost range. Next there is 27 | # one parameter per terrain where -1 means it's variable, 28 | # and any other number indicates that constant cost 29 | CostParameters = 5 0 1 30 | RewardParameters = 80 31 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RRight_TFlip_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | # This map constrats with Prediction_base.ini making all rewards of the kind on the right. 10 | ObjectLocations: 34 45 11 | ObjectTypes: 0 0 12 | ObjectNames: RTreat 13 | 14 | [AgentParameters] 15 | CostPrior: PartialUniform 16 | RewardPrior: ScaledUniform 17 | Restrict: False 18 | Minimum: 1 19 | Capacity: 1 20 | SoftmaxChoice = True 21 | SoftmaxAction = True 22 | RNull = 0.2 23 | CNull = 0 24 | choiceTau = 0.1 25 | actionTau = 0.01 26 | # First parameter notes the cost range. Next there is 27 | # one parameter per terrain where -1 means it's variable, 28 | # and any other number indicates that constant cost 29 | CostParameters = 5 0 1 30 | RewardParameters = 80 31 | -------------------------------------------------------------------------------- /Bishop/Maps/PredictionControlMaps/Prediction_RRight_TKeep_control.ini: -------------------------------------------------------------------------------- 1 | [MapParameters] 2 | DiagonalTravel: True 3 | MapName: Prediction_base_control 4 | # Starting point will get overriden later 5 | StartingPoint: 42 6 | ExitState: 59 7 | 8 | [Objects] 9 | # This map constrats with Prediction_base.ini making all rewards of the kind on the right. 10 | ObjectLocations: 34 45 11 | ObjectTypes: 0 0 12 | ObjectNames: RTreat 13 | 14 | [AgentParameters] 15 | CostPrior: PartialUniform 16 | RewardPrior: ScaledUniform 17 | Restrict: False 18 | Minimum: 1 19 | Capacity: 1 20 | SoftmaxChoice = True 21 | SoftmaxAction = True 22 | RNull = 0.2 23 | CNull = 0 24 | choiceTau = 0.1 25 | actionTau = 0.01 26 | # First parameter notes the cost range. Next there is 27 | # one parameter per terrain where -1 means it's variable, 28 | # and any other number indicates that constant cost 29 | CostParameters = 5 0 1 30 | RewardParameters = 80 31 | -------------------------------------------------------------------------------- /Bishop/Examples/SimulateAgents.py: -------------------------------------------------------------------------------- 1 | # Path generator for a given map 2 | 3 | from Bishop import * 4 | 5 | Observer = LoadObserver("Tatik_T1_L1") 6 | # Simulate different agents 7 | Simulations = Observer.SimulateAgents(Samples=100, HumanReadable=True) 8 | # Simulate same agent over and over again (output only changes is agent is 9 | # softmaxed) 10 | Simulations = Observer.SimulateAgents(Samples=100, HumanReadable=True, ResampleAgent=False) 11 | 12 | # See cost and reward samples and the actions. 13 | Simulations.Costs 14 | Simulations.Rewards 15 | Simulations.Actions 16 | # Save simulations onto a .csv file 17 | Simulations.SaveCSV("MySimulations.csv", overwrite=False) 18 | 19 | # Call using all parameters: 20 | # Simulate 100 agents, output raw action ids, 21 | # resample agent after each simulation 22 | # when agent can take two equally good actions 23 | # select the first one. 24 | Simulations = Observer.SimulateAgents( 25 | Samples=100, 26 | HumanReadable=False, 27 | ResampleAgent=True, 28 | Simple=True) 29 | -------------------------------------------------------------------------------- /MIT-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Julian Jara-Ettinger 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Bishop/Examples/DetailedInference.py: -------------------------------------------------------------------------------- 1 | # Bishop inference 2 | 3 | from Bishop import * 4 | 5 | MapName = "Tatik_T1" 6 | 7 | Observer = Bishop.LoadObserver(MapName) 8 | 9 | Res = Observer.InferAgent( 10 | ActionSequence=['UL', 'R'], Samples=500, Feedback=True) 11 | 12 | # Associate a map name with the samples 13 | Res.AssociateMap(MapName) 14 | # Human-friendly summary 15 | Res.Summary() 16 | # Or print csv-style 17 | Res.Summary(human=False) 18 | # Visually assess if samples converged 19 | Res.AnalyzeConvergence() 20 | # Look at cost and reward posterior plots 21 | Res.PlotCostPosterior() 22 | Res.PlotRewardPosterior() 23 | # Probability that R(A)>R(B) 24 | Res.CompareRewards() 25 | # Get expected costs and rewards 26 | Res.GetExpectedCosts() 27 | Res.GetExpectedRewards() 28 | # Show cost comparison matrix 29 | Res.CompareCosts() 30 | # Do everything above at once 31 | Res.LongSummary() 32 | # Save results 33 | SaveSamples(Res, "MyResults") 34 | 35 | # Load samples 36 | Res = LoadSamples("MyResults.p") 37 | # Or just look at the long summary without returning the files to the workspace 38 | AnalyzeSamples("MyResults.p") 39 | # Load the observer model associated with samples 40 | Observer = LoadObserverFromPC(Res) # Only works if Results had a map associated 41 | -------------------------------------------------------------------------------- /bin/Bishop: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | #!/usr/bin/env python 3 | 4 | """ 5 | Script to quickly run cost-reward inferences on an existing map. 6 | 7 | For help: 8 | >> pytyon BishopInference.py --help 9 | 10 | Example: 11 | 12 | >> python BishopInference.py --map Tatik_T1_L1 --samples 100 --actions "2 2 2" 13 | 14 | runs inference on map Tatik_T1_L1 using 100 samples 15 | and action sequence 2 2 2. 16 | 17 | >> python BishopInference.py --map Tatik_T1_L1 --samples 100 --actions "2 2 2" --output "samples" 18 | or 19 | >> python BishopInference.py -m Tatik_T1_L1 -s 100 -a "2 2 2" -o "samples" 20 | 21 | saves output on "samples.p" as a pickle file. 22 | """ 23 | 24 | __author__ = "Julian Jara-Ettinger" 25 | __license__ = "MIT" 26 | 27 | from Bishop import * 28 | import sys 29 | import argparse 30 | 31 | parser = argparse.ArgumentParser() 32 | parser.add_argument( 33 | "-m", "--map", help="Name of the file with map details (Must be in Bishop's library or in local folder).") 34 | parser.add_argument( 35 | "-a", "--actions", help="Sequence of observed actions (Numerical).") 36 | parser.add_argument( 37 | "-s", "--samples", help="Number of samples to use on inference.", type=int) 38 | parser.add_argument( 39 | "-o", "--output", help="Name of file where to solve samples.") 40 | parser.add_argument( 41 | "-sp", "--startingpoint", help="Agent's starting point.", type=int) 42 | parser.add_argument( 43 | "-v", "--verbose", help="Verbose?", action="store_true") 44 | 45 | args = parser.parse_args() 46 | 47 | if args.map is None: 48 | sys.exit("Map file missing! Type Bishop -h for help.") 49 | 50 | if args.actions is None: 51 | sys.exit("Actions missing! Type Bishop -h for help.") 52 | 53 | if args.samples is None: 54 | sys.exit("How many samples should I use? Type Bishop -h for help.") 55 | 56 | # Don't print yet because we might change the starting point 57 | O = LoadObserver(args.map, False, True) 58 | if args.startingpoint is not None: 59 | O.SetStartingPoint(args.startingpoint, False) 60 | # Need to split args.Actions 61 | ActionSequence = [s for s in args.actions.split()] 62 | if ActionSequence[0].isdigit(): 63 | ActionSequence = [int(s) for s in ActionSequence] 64 | if args.verbose: 65 | O.PrintMap() 66 | Res = O.InferAgent(ActionSequence, args.samples, args.verbose) 67 | Res.AssociateMap(str(args.map)) 68 | Res.MapFile = str(args.map) 69 | if args.output is not None: 70 | SaveSamples(Res, args.output) 71 | if not args.verbose: 72 | if args.output is not None: 73 | Res.Summary(False, args.output) 74 | else: 75 | Res.Summary(False) 76 | -------------------------------------------------------------------------------- /bin/BishopInference.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | #!/usr/bin/env python 3 | 4 | """ 5 | Script to quickly run cost-reward inferences on an existing map. 6 | 7 | For help: 8 | >> pytyon BishopInference.py --help 9 | 10 | Example: 11 | 12 | >> python BishopInference.py --map Tatik_T1_L1 --samples 100 --actions "2 2 2" 13 | 14 | runs inference on map Tatik_T1_L1 using 100 samples 15 | and action sequence 2 2 2. 16 | 17 | >> python BishopInference.py --map Tatik_T1_L1 --samples 100 --actions "2 2 2" --output "samples" 18 | or 19 | >> python BishopInference.py -m Tatik_T1_L1 -s 100 -a "2 2 2" -o "samples" 20 | 21 | saves output on "samples.p" as a pickle file. 22 | """ 23 | 24 | __author__ = "Julian Jara-Ettinger" 25 | __license__ = "MIT" 26 | 27 | from Bishop import * 28 | import sys 29 | import argparse 30 | 31 | parser = argparse.ArgumentParser() 32 | parser.add_argument( 33 | "-m", "--map", help="Name of the file with map details (Must be in Bishop's library or in local folder).") 34 | parser.add_argument( 35 | "-a", "--actions", help="Sequence of observed actions (Numerical).") 36 | parser.add_argument( 37 | "-s", "--samples", help="Number of samples to use on inference.", type=int) 38 | parser.add_argument( 39 | "-o", "--output", help="Name of file where to solve samples.") 40 | parser.add_argument( 41 | "-sp", "--startingpoint", help="Agent's starting point.", type=int) 42 | parser.add_argument( 43 | "-v", "--verbose", help="Verbose?", action="store_true") 44 | 45 | args = parser.parse_args() 46 | 47 | if args.map is None: 48 | sys.exit("Map file missing! Type Bishop -h for help.") 49 | 50 | if args.actions is None: 51 | sys.exit("Actions missing! Type Bishop -h for help.") 52 | 53 | if args.samples is None: 54 | sys.exit("How many samples should I use? Type Bishop -h for help.") 55 | 56 | # Don't print yet because we might change the starting point 57 | O = LoadObserver(args.map, False, True) 58 | if args.startingpoint is not None: 59 | O.SetStartingPoint(args.startingpoint, False) 60 | # Need to split args.Actions 61 | ActionSequence = [s for s in args.actions.split()] 62 | if ActionSequence[0].isdigit(): 63 | ActionSequence = [int(s) for s in ActionSequence] 64 | if args.verbose: 65 | O.PrintMap() 66 | Res = O.InferAgent(ActionSequence, args.samples, args.verbose) 67 | Res.AssociateMap(str(args.map)) 68 | Res.MapFile = str(args.map) 69 | if args.output is not None: 70 | SaveSamples(Res, args.output) 71 | if not args.verbose: 72 | if args.output is not None: 73 | Res.Summary(False, args.output) 74 | else: 75 | Res.Summary(False) 76 | -------------------------------------------------------------------------------- /ChangeLog.txt: -------------------------------------------------------------------------------- 1 | V 1.1.3 2 | ======= 3 | - Big bug fix in incomplete path inferences. 4 | - Big bug fix in Planner.Likelihood(). 5 | - PosteriorContainer has new method, SaveCSV, that exports everything to an R-friendly .csv file 6 | - Expanded AgentSimulation class. 7 | - Optimized Planner.Likelihood() a bit. 8 | - Deleted all .egg files from buggy builds (All versions between 2.1.0 and 2.0.0). 9 | - Other small bug fixes. 10 | 11 | V 1.1.2 12 | ======= 13 | - New class for saving agent simulations (AgentSimulation) 14 | - Support for model testing by correlating generative model input with inferences (Observer.TestModel). 15 | - Improved progress bars. 16 | - Observer.InferAgent() now accepts numeric or string action sequences. 17 | - Bug fixes. 18 | 19 | V 1.1.1 20 | ======= 21 | - Internal restructuring changes. 22 | - Bug fixes. 23 | 24 | V 1.1.0 25 | ======= 26 | - Added support for inference over incomplete paths. 27 | 28 | V 2.0.0 29 | ======= 30 | - Bishop now has a concept of a goal. Rather than planning through a massive MDP it now generates sub-MDPs and does goal-selection through a utility function. 31 | - Lost support for inference over incomplete paths. 32 | 33 | V 2.2.0 34 | ======= 35 | - Cost and reward functions can now be set to constant 36 | - Probability mass centered on 0 can now be set separately for the cost and the reward function (Apathy -> CNull and RNull). 37 | - New support for empirically set priors. 38 | - Maps can now be stored in subfolders. 39 | - Summary functions add sample with highest likelihood. 40 | 41 | V 2.2.1 42 | ======= 43 | - Fixed some naming schemes. LoadMap() is now LoadObserver(). 44 | - AgentSimulation can now also save output into CSV files. 45 | 46 | V 2.3.0 47 | ======= 48 | - Fixed a big bug. Code assumed that the CostMatrix was symmetric and this is not necessarily true. 49 | 50 | V 2.4.0 51 | ======= 52 | - Modified ValueIteration and Policy builder on MDP. Replacing target state on subMDPs for a big reward biased the agent to push diagonal actions to the end (because that way you save square root of 2 cost). 53 | 54 | V 2.5.0 55 | ======= 56 | - Agents now have a minimum number of objects to collect and a capacity. 57 | - Updated examples and documentation. 58 | - More priors. 59 | - Incomplete path support. 60 | - Support for using posterior samples as priors on a new map. 61 | 62 | V 2.5.3 63 | ======= 64 | - Fixed a bug with the discount utility method. 65 | - Support for reusing posterior samples as the prior in a new map (if there are new terrains or objects, these dimensions get resampled). 66 | - Methods for predicting future actions and future plans. 67 | - High level methods for retrieving costs and rewards (O.GetCR()), and methods for running the generative model and saving the outputs as images (O.DrawSimulations()) 68 | 69 | V 2.6 70 | ======= 71 | - Discount method is now integrated with linear methods. By setting organic markers you can determine which objects are subject to future discount (interpreted as probability of death at each time step). 72 | - ProbabilityofNoChange and CompareInferences allow comparing inferences from two events. 73 | - Removed some old maps to make map library smaller. 74 | -------------------------------------------------------------------------------- /Bishop/AgentSimulation.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | Store results from agent simulations 5 | """ 6 | 7 | import sys 8 | import os.path 9 | 10 | 11 | class AgentSimulation(object): 12 | 13 | def __init__(self, Costs, Rewards, Actions, States, ObjectNames=None, CostNames=None): 14 | """ 15 | Create an object that stores simulation results. 16 | 17 | Args: 18 | Costs (list): List of cost samples 19 | Rewards (list): List of reward samples 20 | Actions (list): List of action sequences 21 | States (list): List of state transitions 22 | """ 23 | self.Costs = Costs 24 | self.Rewards = Rewards 25 | self.Actions = Actions 26 | self.States = States 27 | self.ObjectNames = ObjectNames 28 | self.CostNames = CostNames 29 | self.CostDimensions = len(self.Costs[0]) 30 | if self.Rewards[0] is not None: 31 | self.RewardDimensions = len(self.Rewards[0]) 32 | else: 33 | self.RewardDimensions = None 34 | self.SampleNo = len(self.Costs) 35 | 36 | def PrintActions(self): 37 | """ 38 | Pretty print action simulations 39 | """ 40 | for i in range(len(self.Actions)): 41 | sys.stdout.write(str(self.Actions[i]) + "\n") 42 | 43 | def SaveCSV(self, filename, overwrite=False): 44 | """ 45 | Export simulation samples as a .csv file 46 | 47 | Args: 48 | filename (str): Filename 49 | overwrite (bool): Overwrite file if it exists? 50 | """ 51 | Header = "" 52 | if os.path.isfile(filename) and not overwrite: 53 | print(("ERROR: File exists, type SaveCSV(\"" + filename + "\",True) to overwrite file.")) 54 | else: 55 | f = open(filename, 'w') 56 | # Create header 57 | if self.ObjectNames is not None: 58 | for i in range(len(self.ObjectNames)): 59 | if i == 0: 60 | Header = str(self.ObjectNames[i]) 61 | else: 62 | Header = Header + "," + str(self.ObjectNames[i]) 63 | else: 64 | for i in range(self.RewardDimensions): 65 | if i == 0: 66 | Header = "Object" + str(i) 67 | else: 68 | Header = Header + ",Object" + str(i) 69 | if self.CostNames is not None: 70 | for i in self.CostNames: 71 | Header = Header + "," + str(i) 72 | else: 73 | for i in range(self.CostDimensions): 74 | Header = Header + ",Terrain" + str(i) 75 | Header = Header + ",Actions,States\n" 76 | f.write(Header) 77 | # Now add the samples 78 | NewLine = "" 79 | for i in range(self.SampleNo): 80 | if self.RewardDimensions is not None: 81 | for j in range(self.RewardDimensions): 82 | if j == 0: 83 | NewLine = str(self.Rewards[i][j]) 84 | else: 85 | NewLine = NewLine + "," + str(self.Rewards[i][j]) 86 | for j in range(self.CostDimensions): 87 | NewLine = NewLine + "," + str(self.Costs[i][j]) 88 | # Print actions 89 | NewLine = NewLine + "," 90 | for action in self.Actions[i]: 91 | NewLine = NewLine + str(action) + "-" 92 | # Print states 93 | NewLine = NewLine + "," 94 | for state in self.States[i]: 95 | NewLine = NewLine + str(state) + "-" 96 | NewLine = NewLine + "\n" 97 | f.write(NewLine) 98 | f.close() 99 | 100 | def Display(self, Full=True): 101 | """ 102 | Print object attributes. 103 | 104 | .. Warning:: 105 | 106 | This function is for internal use only. 107 | 108 | Args: 109 | Full (bool): When set to False, function only prints attribute names. Otherwise, it also prints its values. 110 | 111 | Returns: 112 | standard output summary 113 | """ 114 | if Full: 115 | for (property, value) in vars(self).items(): 116 | print((property, ': ', value)) 117 | else: 118 | for (property, value) in vars(self).items(): 119 | print(property) 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #Bishop 2 | ______ 3 | 4 | ## About 5 | 6 | Bishop, after [Washington Bishop](http://en.wikipedia.org/wiki/Washington_Irving_Bishop), is a python (3) package for modeling [Theory of mind](http://en.wikipedia.org/wiki/Theory_of_mind). Given some observable behavior, Bishop infers (through Bayesian inference over a rational model of decision making and planning under uncertainty) the cost and reward functions that explain the agent's choices and actions. 7 | 8 | ## Install and uninstall 9 | 10 | python setup.py install 11 | pip uninstall Bishop 12 | 13 | ## Using Bishop 14 | 15 | The main object in Bishop are observers. Observers are agents with a Theory of Mind that can infer mental-states from action, predict an agent's future actions, and simulate behaviors. 16 | 17 | Simulate agents: 18 | 19 | from Bishop import * 20 | Observer = LoadObserver("P_TT_TRE") # Load a ToM agent that is observing the P_TT_TRE map. 21 | R = Observer.SimulateAgents(Samples=100) # Have the observer 'imagine' the behavior of 100 random agents. 22 | R.SaveCSV("MySamples.csv") # Save costs, rewards, actions, and state transitions as a CSV file. 23 | R.Display() # Print everything 24 | 25 | To see a list of available maps: 26 | 27 | ShowAvailableMaps() # Print all maps 28 | ShowAvailableMaps("Flag") # Print maps that contain the word "Flag" 29 | 30 | #### Cost-reward inference given observable actions 31 | 32 | #### From the terminal 33 | 34 | $Bishop --help 35 | $Bishop -m P_TT_TRE -sp 0 -a "R R" -s 5000 -o MySamples -v 36 | 37 | uses the P_TT_TRE file (in Bishop's library) to load the map and places an agent in location 0 who took two steps to the right. It then infers the cost and reward function using 5000 samples and stores the output in "MySamples.p" 38 | 39 | #### Inside python 40 | 41 | Obs = LoadObserver("Tatik_T1_L1") # Load a ToM agent observing the Tatik_T1_L1 map. 42 | # InferAgent takes a sequence of actions and run mental-state inference on them. 43 | # The actions must be given as a list of the following movements: 'U' (up), 'D' (down), 'L' (left), 'R' (right) 44 | # 'UL' ("up-left"; northwest diagonal), 'UR' (northeast diagonal), 'DL' (southwest diagonal), and 'DR' (southeast diagonal). 45 | Res = Obs.InferAgent(['UL'], Samples=100, Feedback=True) #UL (Up-Left) is a diagonal move 46 | 47 | The Observer.InferAgent returns a __PosteriorContainer__ object. This object contains the mental-state and competence inferences as well as functions to assess the quality of inference. Here are some things you can do with it 48 | 49 | Res.Summary() 50 | Res.Summary(human=False) # Or print it in csv-format 51 | Res.AnalyzeConvergence() # Visually check if sampling converged 52 | Res.PlotCostPosterior() 53 | Res.PlotRewardPosterior() 54 | Res.LongSummary() # Do everything above. 55 | SaveSamples(Res, "MyResults") # Bishop is sampling based, so you can store the samples with their likelihoods 56 | 57 | You can reload the samples and the observer model later with 58 | 59 | Res = LoadSamples("MyResults.p") 60 | Obs = LoadObserverFromPC(Res) 61 | 62 | ## Creating a new map 63 | 64 | ### Through configuration files 65 | 66 | A map consists of two files: An ASCII description, and a .ini configuration file. 67 | 68 | ASCII files begin with a map drawing, with each terrain type indicated numerically. After a line break, each terrain name is specified in a single line. These are the files for "FlagSetup" map 69 | 70 | __FlagSetup.ini__ 71 | 72 | [MapParameters] 73 | DiagonalTravel: True 74 | MapName: Flag_Map 75 | # Starting point can get overriden later with Observer.SetStartingPoint() 76 | StartingPoint: 2 77 | ExitState: 58 78 | 79 | [Objects] 80 | ObjectLocations: 41 49 81 | ObjectTypes: 0 1 82 | ObjectNames: LTreat RTreat 83 | # If the two treats were the same type: 84 | # ObjectTypes: 0 0 85 | # ObjectNames: OnlyOneNameNeeded 86 | 87 | [AgentParameters] 88 | Method: Linear # Determines how costs are treated. 89 | # If linear then costs are substracted from rewards. 90 | # if discount then costs are treated as future discounts over rewards. 91 | # Prior over costs and rewards. 92 | Prior: ScaledUniform 93 | # Force terrain 0 to be always less costly than the rest? 94 | Restrict: False 95 | SoftmaxChoice = False 96 | SoftmaxAction = False 97 | # Softmax parameters 98 | # actionTau = 0.01 99 | # choiceTau = 0.01 100 | # When different than 0 prior becomes a mixture of the 101 | # prior above with a peak in 0. The value determines the mass on that point. 102 | RNull = 0.2 103 | CNull = 0 104 | # Parameters for priors. Meaning changes depending on the prior. See docstrings 105 | CostParameters = 1 106 | RewardParameters = 10 107 | 108 | 109 | __FlagMap__ 110 | 111 | 0000011122222 112 | 0000011122222 113 | 0000011122222 114 | 0000011122222 115 | 0000011122222 116 | 0000011122222 117 | 0000011122222 118 | 119 | LeftTerrainName 120 | CenterTerrainName 121 | RightTerrainName 122 | 123 | ### Building a map inside python 124 | 125 | ##### Map skeleton 126 | 127 | To generate a simple grid-world with one terrain start with 128 | 129 | MyMap = Map() 130 | MyMap.BuildGridWorld(5,3,Diagonal=True) 131 | 132 | This creates a 5 by 3 map that can be navigated diagonally. Terrain type is stored in MyMap.StateTypes. The first terrain has by default a value of 0. New terrains are added through squares: 133 | 134 | MyMap.InsertSquare(2, 1, 2, 3, 1): 135 | 136 | added a 2x3 square with the top-left corner positioned on (2,1). Both coordinates begin in 1 and the y-axis is counted from top to bottom. The last argument (1) gives the terrain code. Inserting overlapping squares always rewrites past terrain. You can then add terrain names 137 | 138 | MyMap.AddTerrainNames(["Water","Jungle"]) 139 | 140 | To see what your map looks like type 141 | 142 | MyMap.PrintMap() 143 | 144 | ##### Adding starting point, exit point, and objects 145 | 146 | See docstrings for 147 | 148 | MyMap.AddStartingPoint() 149 | MyMap.AddExitState() 150 | MyMap.InsertObjects() 151 | 152 | ##### Using the map 153 | 154 | Once you have a map, you need to create an agent, and use both to create an observer 155 | 156 | MyAgent = Agent(MyMap, CostPrior, RewardPrior, CostPriorParameters, RewardPriorParameters) 157 | MyObserver = Observer(MyMap, MyAgent) 158 | 159 | See Agent's constructor docstring for list of all parameters agent can take and more details. 160 | -------------------------------------------------------------------------------- /bishop.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: Bishop 3 | Version: 3 4 | Summary: Cognitive model of Theory of Mind 5 | Home-page: http://gibthub.com/julianje/bishop 6 | Author: Julian Jara-Ettinger 7 | Author-email: UNKNOWN 8 | License: MIT 9 | Description: #Bishop 10 | ______ 11 | 12 | ## About 13 | 14 | Bishop, after [Washington Bishop](http://en.wikipedia.org/wiki/Washington_Irving_Bishop), is a python (3) package for modeling [Theory of mind](http://en.wikipedia.org/wiki/Theory_of_mind). Given some observable behavior, Bishop infers (through Bayesian inference over a rational model of decision making and planning under uncertainty) the cost and reward functions that explain the agent's choices and actions. 15 | 16 | ## Install and uninstall 17 | 18 | python setup.py install 19 | pip uninstall Bishop 20 | 21 | ## Using Bishop 22 | 23 | The main object in Bishop are observers. Observers are agents with a Theory of Mind that can infer mental-states from action, predict an agent's future actions, and simulate behaviors. 24 | 25 | Simulate agents: 26 | 27 | from Bishop import * 28 | Observer = LoadObserver("P_TT_TRE") # Load a ToM agent that is observing the P_TT_TRE map. 29 | R = Observer.SimulateAgents(Samples=100) # Have the observer 'imagine' the behavior of 100 random agents. 30 | R.SaveCSV("MySamples.csv") # Save costs, rewards, actions, and state transitions as a CSV file. 31 | R.Display() # Print everything 32 | 33 | To see a list of available maps: 34 | 35 | ShowAvailableMaps() # Print all maps 36 | ShowAvailableMaps("Flag") # Print maps that contain the word "Flag" 37 | 38 | #### Cost-reward inference given observable actions 39 | 40 | #### From the terminal 41 | 42 | $Bishop --help 43 | $Bishop -m P_TT_TRE -sp 0 -a "R R" -s 5000 -o MySamples -v 44 | 45 | uses the P_TT_TRE file (in Bishop's library) to load the map and places an agent in location 0 who took two steps to the right. It then infers the cost and reward function using 5000 samples and stores the output in "MySamples.p" 46 | 47 | #### Inside python 48 | 49 | Obs = LoadObserver("Tatik_T1_L1") # Load a ToM agent observing the Tatik_T1_L1 map. 50 | # InferAgent takes a sequence of actions and run mental-state inference on them. 51 | # The actions must be given as a list of the following movements: 'U' (up), 'D' (down), 'L' (left), 'R' (right) 52 | # 'UL' ("up-left"; northwest diagonal), 'UR' (northeast diagonal), 'DL' (southwest diagonal), and 'DR' (southeast diagonal). 53 | Res = Obs.InferAgent(['UL'], Samples=100, Feedback=True) #UL (Up-Left) is a diagonal move 54 | 55 | The Observer.InferAgent returns a __PosteriorContainer__ object. This object contains the mental-state and competence inferences as well as functions to assess the quality of inference. Here are some things you can do with it 56 | 57 | Res.Summary() 58 | Res.Summary(human=False) # Or print it in csv-format 59 | Res.AnalyzeConvergence() # Visually check if sampling converged 60 | Res.PlotCostPosterior() 61 | Res.PlotRewardPosterior() 62 | Res.LongSummary() # Do everything above. 63 | SaveSamples(Res, "MyResults") # Bishop is sampling based, so you can store the samples with their likelihoods 64 | 65 | You can reload the samples and the observer model later with 66 | 67 | Res = LoadSamples("MyResults.p") 68 | Obs = LoadObserverFromPC(Res) 69 | 70 | ## Creating a new map 71 | 72 | ### Through configuration files 73 | 74 | A map consists of two files: An ASCII description, and a .ini configuration file. 75 | 76 | ASCII files begin with a map drawing, with each terrain type indicated numerically. After a line break, each terrain name is specified in a single line. These are the files for "FlagSetup" map 77 | 78 | __FlagSetup.ini__ 79 | 80 | [MapParameters] 81 | DiagonalTravel: True 82 | MapName: Flag_Map 83 | # Starting point can get overriden later with Observer.SetStartingPoint() 84 | StartingPoint: 2 85 | ExitState: 58 86 | 87 | [Objects] 88 | ObjectLocations: 41 49 89 | ObjectTypes: 0 1 90 | ObjectNames: LTreat RTreat 91 | # If the two treats were the same type: 92 | # ObjectTypes: 0 0 93 | # ObjectNames: OnlyOneNameNeeded 94 | 95 | [AgentParameters] 96 | Method: Linear # Determines how costs are treated. 97 | # If linear then costs are substracted from rewards. 98 | # if discount then costs are treated as future discounts over rewards. 99 | # Prior over costs and rewards. 100 | Prior: ScaledUniform 101 | # Force terrain 0 to be always less costly than the rest? 102 | Restrict: False 103 | SoftmaxChoice = False 104 | SoftmaxAction = False 105 | # Softmax parameters 106 | # actionTau = 0.01 107 | # choiceTau = 0.01 108 | # When different than 0 prior becomes a mixture of the 109 | # prior above with a peak in 0. The value determines the mass on that point. 110 | RNull = 0.2 111 | CNull = 0 112 | # Parameters for priors. Meaning changes depending on the prior. See docstrings 113 | CostParameters = 1 114 | RewardParameters = 10 115 | 116 | 117 | __FlagMap__ 118 | 119 | 0000011122222 120 | 0000011122222 121 | 0000011122222 122 | 0000011122222 123 | 0000011122222 124 | 0000011122222 125 | 0000011122222 126 | 127 | LeftTerrainName 128 | CenterTerrainName 129 | RightTerrainName 130 | 131 | ### Building a map inside python 132 | 133 | ##### Map skeleton 134 | 135 | To generate a simple grid-world with one terrain start with 136 | 137 | MyMap = Map() 138 | MyMap.BuildGridWorld(5,3,Diagonal=True) 139 | 140 | This creates a 5 by 3 map that can be navigated diagonally. Terrain type is stored in MyMap.StateTypes. The first terrain has by default a value of 0. New terrains are added through squares: 141 | 142 | MyMap.InsertSquare(2, 1, 2, 3, 1): 143 | 144 | added a 2x3 square with the top-left corner positioned on (2,1). Both coordinates begin in 1 and the y-axis is counted from top to bottom. The last argument (1) gives the terrain code. Inserting overlapping squares always rewrites past terrain. You can then add terrain names 145 | 146 | MyMap.AddTerrainNames(["Water","Jungle"]) 147 | 148 | To see what your map looks like type 149 | 150 | MyMap.PrintMap() 151 | 152 | ##### Adding starting point, exit point, and objects 153 | 154 | See docstrings for 155 | 156 | MyMap.AddStartingPoint() 157 | MyMap.AddExitState() 158 | MyMap.InsertObjects() 159 | 160 | ##### Using the map 161 | 162 | Once you have a map, you need to create an agent, and use both to create an observer 163 | 164 | MyAgent = Agent(MyMap, CostPrior, RewardPrior, CostPriorParameters, RewardPriorParameters) 165 | MyObserver = Observer(MyMap, MyAgent) 166 | 167 | See Agent's constructor docstring for list of all parameters agent can take and more details. 168 | 169 | Platform: UNKNOWN 170 | -------------------------------------------------------------------------------- /Bishop/MDP.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | Markov Decision Process solver. 5 | """ 6 | 7 | import numpy as np 8 | import math 9 | import random 10 | 11 | 12 | class MDP(object): 13 | 14 | def __init__(self, S=[], A=[], T=[], R=[], gamma=0.95, tau=0.01): 15 | """ 16 | Markov Decision Process (MDP) class. 17 | 18 | Args: 19 | S (list): List of states 20 | A (list): List of actions 21 | T (matrix): Transition matrix where T[SO,A,SF] is the probability of moving from So to SF after taking action A 22 | R (matrix): Reward function where R[A,S] is the reward for taking action A in state S 23 | gamma (float): Future discount 24 | tau (float): Softmax parameter 25 | 26 | Returns: 27 | MDP object 28 | """ 29 | self.S = S 30 | self.A = A 31 | self.T = T 32 | self.R = R 33 | self.gamma = gamma 34 | self.tau = tau 35 | self.values = np.zeros((1, len(S))) 36 | # Where we'll store the softmaxed probabilities 37 | self.policy = np.zeros((len(A), len(S))) 38 | 39 | def ValueIteration(self, epsilon=0.0001): 40 | """ 41 | Perform value iteration on MDP. 42 | 43 | Calculates each state's value and saves them in MDP's values attribute 44 | 45 | Args: 46 | epsilon (float): Convergence parameter 47 | 48 | Returns: 49 | None 50 | """ 51 | self.values = np.zeros(self.values.shape) 52 | while True: 53 | V2 = self.values.copy() 54 | for i in range(0, len(self.S)): 55 | prod = self.gamma * \ 56 | (np.mat(self.T[i, :, :]) * np.mat(V2.transpose())) 57 | self.values[0, i] = max(prod[j] + self.R[j, i] 58 | for j in range(len(self.A))) 59 | # options = [(self.R[j, i] + self.gamma * (np.mat(self.T[i, :, :])) 60 | # * np.mat(V2.transpose())).max() for j in range(len(self.A))] 61 | #self.values[0, i] = max(options) 62 | if (self.values - V2).max() <= epsilon: 63 | break 64 | 65 | def Validate(self): 66 | """ 67 | Check that MDP object is correct. 68 | 69 | Args: 70 | None 71 | """ 72 | print("Validating MDP...") 73 | dims = self.T.shape 74 | states = len(self.S) 75 | actions = len(self.A) 76 | if (dims[0] != dims[2]): 77 | print("ERROR: Transition matrix is not square. MDP-001") 78 | return 0 79 | if (states != dims[0]): 80 | print("ERROR: Transition matrix does not match number of states. MDP-002") 81 | return 0 82 | if self.S != list(range(states)): 83 | print("ERROR: States are not correctly numbered. MDP-003") 84 | return 0 85 | if self.A != list(range(actions)): 86 | print("ERROR: Actions are not correctly numbered. MDP-004") 87 | return 0 88 | if (dims[1] != actions): 89 | print("ERROR: Transition matrix does not match number of actions. MDP-005") 90 | return 0 91 | if (self.gamma >= 1) or (self.gamma <= 0): 92 | print("ERROR: Invalida value of gamma. MDP-006") 93 | return 0 94 | if (self.tau <= 0): 95 | if (self.tau is not None): 96 | print("ERROR: Invalida value of tau. MDP-009") 97 | return 0 98 | # Check that every vector adds up to 1 99 | res = (np.ndarray.flatten(np.sum(self.T, axis=2)) == 1) 100 | if len(res) != sum(res): 101 | print("ERROR: Transition matrix rows do not add up to 1. MDP-007") 102 | return 0 103 | return 1 104 | 105 | def BuildPolicy(self, Softmax=True): 106 | """ 107 | Build optimal policy 108 | 109 | Calculates MDPs optimal policy 110 | 111 | Args: 112 | Softmax (bool): Indicates if actions are softmaxed. 113 | 114 | Returns: 115 | None 116 | """ 117 | # Build a policy using the results from value iteration 118 | for i in range(0, len(self.S)): 119 | options = np.mat( 120 | self.T[i, :, :]) * np.mat(self.values.transpose()) 121 | options = options.tolist() 122 | # Prevent softmax from overflowing 123 | maxval = abs(max(options)[0]) 124 | options = [options[j][0] - maxval for j in range(len(options))] 125 | # Softmax the policy 126 | if Softmax: 127 | try: 128 | options = [math.exp(options[j] / self.tau) 129 | for j in range(len(options))] 130 | except OverflowError: 131 | print("ERROR: Failed to softmax policy. MDP-008") 132 | raise 133 | # If all actions have no value then set a uniform distribution 134 | if sum(options) == 0: 135 | self.policy[:, i] = [ 136 | 1.0 / len(options) for j in range(len(options))] 137 | else: 138 | self.policy[:, i] = [ 139 | options[j] / sum(options) for j in range(len(options))] 140 | else: 141 | totalchoices = sum([options[optloop] == max(options) 142 | for optloop in range(len(options))]) 143 | self.policy[:, i] = [(1.0 / totalchoices if options[optloop] == max(options) else 0) 144 | for optloop in range(len(options))] 145 | 146 | def GetStates(self, StartingPoint, ActionSequence): 147 | """ 148 | Produce the sequence of states with highest likelihood given a starting point and sequence of actions. 149 | 150 | Args: 151 | StartingPoint (int): State number where agent begins. 152 | ActionSequence (list): List of indices of actions. 153 | 154 | Returns: 155 | List of state numbers 156 | """ 157 | StateSequence = [0] * (len(ActionSequence) + 1) 158 | StateSequence[0] = StartingPoint 159 | for i in range(len(ActionSequence)): 160 | StateSequence[i + 1] = ( 161 | self.T[StateSequence[i], ActionSequence[i], :]).argmax() 162 | return StateSequence 163 | 164 | def Run(self, State, Softmax=False, Simple=False): 165 | """ 166 | Sample an action from the optimal policy given the state. 167 | Note that if softmax is set to true then Simple is ignored (see below). 168 | 169 | Args: 170 | State (int): State number where agent begins. 171 | Softmax (bool): Simulate with softmaxed policy? 172 | Simple (bool): Some states have various actions all with an equally high value. 173 | when this happens, Run() randomly selects one of these actions. 174 | if Simple is set to True, it selects the first highest-value action. 175 | 176 | Returns: 177 | List of state numbers 178 | """ 179 | if Softmax: 180 | # If softmaxing then select a random sample 181 | ActSample = random.uniform(0, 1) 182 | ActionProbs = self.policy[:, State] 183 | ActionChoice = -1 184 | for j in range(len(ActionProbs)): 185 | if ActSample < ActionProbs[j]: 186 | ActionChoice = j 187 | break 188 | else: 189 | ActSample -= ActionProbs[j] 190 | else: 191 | maxval = max(self.policy[:, State]) 192 | maxindices = [ 193 | i for i, j in enumerate(self.policy[:, State]) if j == maxval] 194 | if Simple: 195 | ActionChoice = maxindices[0] 196 | else: 197 | ActionChoice = random.choice(maxindices) 198 | # Now find the next state 199 | EndStates = self.T[State, ActionChoice, :] 200 | StateSample = random.uniform(0, 1) 201 | for j in range(len(EndStates)): 202 | if StateSample < EndStates[j]: 203 | EndState = j 204 | break 205 | else: 206 | StateSample -= EndStates[j] 207 | return [EndState, ActionChoice] 208 | 209 | def Display(self, Full=False): 210 | """ 211 | Print object attributes. 212 | 213 | .. Internal function:: 214 | 215 | This function is for internal use only. 216 | 217 | Args: 218 | Full (bool): When set to False, function only prints attribute names. Otherwise, it also prints its values. 219 | 220 | Returns: 221 | standard output summary 222 | """ 223 | if Full: 224 | for (property, value) in vars(self).items(): 225 | print((property, ': ', value)) 226 | else: 227 | for (property, value) in vars(self).items(): 228 | print(property) 229 | -------------------------------------------------------------------------------- /Bishop/Agent.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | Stores information about agent and comes with supporting methods to sample random agents. 5 | """ 6 | 7 | import random 8 | import numpy as np 9 | 10 | 11 | class Agent(object): 12 | 13 | def __init__(self, Map, CostPrior, RewardPrior, CostParams, RewardParams, Capacity=-1, Minimum=0, SoftmaxChoice=True, SoftmaxAction=True, choiceTau=1, actionTau=0.01, CNull=0, RNull=0, Restrict=False): 14 | """ 15 | Agent class. 16 | 17 | Create an agent with a set of costs and rewards. 18 | If sampling parameters are numbers rather than lists the constructor fixes this automatically. 19 | 20 | Args: 21 | Map (Map): A map object. 22 | CostPrior (str): String indicating prior's name. Run Agent.Priors() to see list 23 | RewardPrior (str): String indicating Reward prior's name. Run Agent.Priors() to see list 24 | CostParams (list): List of parameters for sampling costs. 25 | RewardParams (list): List of parameters for sampling rewards. 26 | Capacity (int): Number of objects agent can carry. If set to -1 Planner adjusts 27 | it to the total number of objects in the map. 28 | Minimum (int): Minimum number of objects must take before leaving. 29 | SoftmaxChoice (bool): Does the agent select goals optimally? 30 | SoftmaxAction (bool): Does the agent act upong goals optimally? 31 | choiceTau (float): Softmax parameter for goal selection. 32 | actionTau (float): Softmax parameter for action planning. 33 | CNull (float): Probability that a terrain has no cost. 34 | RNull (float): Probability that an object has no reward 35 | Restrict (bool): When set to true the cost samples make the first terrain 36 | always less costly than the rest. 37 | """ 38 | # Check that priors exist. 39 | Priors = self.Priors(False) 40 | if CostPrior in Priors: 41 | self.CostPrior = CostPrior 42 | else: 43 | print("WARNING: Cost prior not found! Setting to uniform") 44 | self.CostPrior = "ScaledUniform" 45 | if RewardPrior in Priors: 46 | self.RewardPrior = RewardPrior 47 | else: 48 | print("WARNING; Reward prior not found! Setting to uniform") 49 | self.RewardPrior = "ScaledUniform" 50 | self.Restrict = Restrict 51 | self.CostDimensions = len(np.unique(Map.StateTypes)) 52 | # Get dimensions over which you'll build your simplex 53 | self.RewardDimensions = len(set(Map.ObjectTypes)) 54 | self.Capacity = Capacity 55 | self.Minimum = Minimum 56 | self.SoftmaxChoice = SoftmaxChoice 57 | self.SoftmaxAction = SoftmaxAction 58 | if SoftmaxAction: 59 | self.actionTau = actionTau 60 | else: 61 | self.actionTau = None 62 | if SoftmaxChoice: 63 | self.choiceTau = choiceTau 64 | else: 65 | self.choiceTau = None 66 | if self.RewardDimensions == 0: 67 | print("WARNING: No rewards on map. AGENT-001") 68 | if isinstance(CostParams, list): 69 | self.CostParams = CostParams 70 | else: 71 | self.CostParams = [CostParams] 72 | if isinstance(RewardParams, list): 73 | self.RewardParams = RewardParams 74 | else: 75 | self.RewardParams = [RewardParams] 76 | self.CNull = CNull 77 | self.RNull = RNull 78 | self.ResampleCosts() # Generate random cost of map 79 | self.ResampleRewards() # Generate random rewards for objects 80 | 81 | def ResampleAgent(self): 82 | """ 83 | Reset agent with random costs and rewards. 84 | 85 | Args: 86 | Restrict (bool): If true, first terrain is always the least costly 87 | 88 | Returns: 89 | None 90 | """ 91 | self.ResampleCosts() 92 | self.ResampleRewards() 93 | if self.Restrict: 94 | temp = self.costs[0] 95 | new = self.costs.argmin() 96 | minval = self.costs[new] 97 | self.costs[new] = temp 98 | self.costs[0] = minval 99 | 100 | def ResampleCosts(self): 101 | """ 102 | Reset agent's costs. 103 | """ 104 | # Resample the agent's competence 105 | self.costs = self.Sample( 106 | self.CostDimensions, self.CostParams, Kind=self.CostPrior) 107 | self.costs = [ 108 | 0 if random.random() <= self.CNull else i for i in self.costs] 109 | 110 | def ResampleRewards(self): 111 | """ 112 | Reset agent's rewards. 113 | 114 | Returns: 115 | None 116 | """ 117 | # Resample the agent's preferences 118 | self.rewards = self.Sample( 119 | self.RewardDimensions, self.RewardParams, Kind=self.RewardPrior) 120 | if self.rewards is not None: 121 | self.rewards = [ 122 | 0 if random.random() <= self.RNull else i for i in self.rewards] 123 | 124 | def Sample(self, dimensions, SamplingParam, Kind): 125 | """ 126 | Generate a sample from some distribution 127 | 128 | Args: 129 | dimensions (int): Number of dimensions 130 | SamplingParam (list): Parameter to use on distribution 131 | Kind (str): Name of distribution 132 | 133 | Returns: 134 | None 135 | """ 136 | if dimensions == 0: 137 | return None 138 | if (Kind == "Simplex"): 139 | # Output: Simplex sample of length 'dimensions' (Adds to 1) 140 | sample = -np.log(np.random.rand(dimensions)) 141 | return sample / sum(sample) 142 | if (Kind == "IntegerUniform"): 143 | return np.round(np.random.rand(dimensions) * SamplingParam[0]) 144 | if (Kind == "ScaledUniform"): 145 | return np.random.rand(dimensions) * SamplingParam[0] 146 | if (Kind == "Gaussian"): 147 | return np.random.normal(SamplingParam[0], SamplingParam[1], dimensions) 148 | if (Kind == "Exponential"): 149 | return [np.random.exponential(SamplingParam[0]) for j in range(dimensions)] 150 | if (Kind == "Constant"): 151 | return [0.5 * SamplingParam[0]] * dimensions 152 | if (Kind == "Beta"): 153 | return [np.random.beta(SamplingParam[0], SamplingParam[1]) for i in range(dimensions)] 154 | if (Kind == "Empirical"): 155 | return [random.choice(SamplingParam) for i in range(dimensions)] 156 | if (Kind == "PartialUniform"): 157 | # Generate random samples and scale them by the first parameter. 158 | samples = np.random.rand(dimensions) * SamplingParam[0] 159 | # Now iterate over the sampling parameters and push in static 160 | # values. 161 | for i in range(1, len(SamplingParam)): 162 | if SamplingParam[i] != -1: 163 | samples[i - 1] = SamplingParam[i] 164 | return samples 165 | if (Kind == "PartialGaussian"): 166 | # Generate random gaussian samples. 167 | samples = np.random.normal( 168 | SamplingParam[0], SamplingParam[1], dimensions) 169 | # Now iterate over the sampling parameters and push in static 170 | # values. 171 | for i in range(2, len(SamplingParam)): 172 | if SamplingParam[i] != -1: 173 | samples[i - 2] = SamplingParam[i] 174 | samples = [0 if i < 0 else i for i in samples] 175 | return samples 176 | 177 | def Priors(self, human=True): 178 | """ 179 | Print list of supported priors. 180 | 181 | PRIORS: 182 | Simplex: No arguments needed. 183 | IntegerUniform: argument is one real/int that scales the vector 184 | ScaledUniform: argument is one real/int that scales the vector 185 | Gaussian: First argument is the mean and second argument is the standard deviation. 186 | PartialGaussian: First two arguments are the same as Gaussian. Next there should be N arguments 187 | with N = number of terrains. When Nth value after the main to is -1, the terrain cost gets sampled 188 | from the gaussian distribution, when the value is different it is held constant. See also PartialUniform. 189 | Exponential: First parameter is lambda 190 | Constant: First parameter is the constant value. 191 | Beta: First parameter is alpha and second is beta. 192 | PartialUniform: First parameter as a real/int that scales the vector. This argument should be followed by a list of numbers 193 | that matches the number of terrains. If the entry for terrain i is -1 that terrain get resampled and scaled, if it contains any value 194 | then the terrain is left constant at that value. E.g., a two terrain world with a PartialUniform prior and parameters 10 -1 0.25 195 | generates priors where the first terrain is uniform between 0 and 10, and the second paramter is always 0.25 196 | 197 | Args: 198 | human (bool): If true function prints names, otherwise it returns a list. 199 | """ 200 | Priors = ['Simplex', 'IntegerUniform', 'ScaledUniform', 'Beta', 201 | 'Gaussian', 'PartialGaussian', 'Exponential', 'Constant', 'Empirical', 'PartialUniform'] 202 | if human: 203 | for Prior in Priors: 204 | print(Prior) 205 | else: 206 | return Priors 207 | 208 | def GetSamplingParameters(self): 209 | """ 210 | Return cost and reward sampling parameters, respectively 211 | """ 212 | return [self.CostParams, self.RewardParams] 213 | 214 | def SetCostSamplingParams(self, samplingparams): 215 | """ 216 | Set sampling parameters for costs 217 | """ 218 | if len(samplingparams) != len(self.CostParams): 219 | print("Vector of parameters is not the right size") 220 | else: 221 | self.CostParams = samplingparams 222 | 223 | def SetRewardSamplingParams(self, samplingparams): 224 | """ 225 | Set sampling parameters for costs 226 | """ 227 | if len(samplingparams) != len(self.RewardParams): 228 | print("Vector of parameters is not the right size") 229 | else: 230 | self.RewardParams = samplingparams 231 | 232 | def Display(self, Full=True): 233 | """ 234 | Print object attributes. 235 | 236 | .. Warning:: 237 | 238 | This function is for internal use only. 239 | 240 | Args: 241 | Full (bool): When set to False, function only prints attribute names. Otherwise, it also prints its values. 242 | 243 | Returns: 244 | standard output summary 245 | """ 246 | if Full: 247 | for (property, value) in vars(self).items(): 248 | print((property, ': ', value)) 249 | else: 250 | for (property, value) in vars(self).items(): 251 | print(property) 252 | -------------------------------------------------------------------------------- /bishop.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | MANIFEST.in 2 | README.md 3 | setup.py 4 | Bishop/Agent.py 5 | Bishop/AgentSimulation.py 6 | Bishop/AuxiliaryFunctions.py 7 | Bishop/MDP.py 8 | Bishop/Map.py 9 | Bishop/Observer.py 10 | Bishop/Planner.py 11 | Bishop/PosteriorContainer.py 12 | Bishop/__init__.py 13 | Bishop.egg-info/.DS_Store 14 | Bishop.egg-info/PKG-INFO 15 | Bishop.egg-info/SOURCES.txt 16 | Bishop.egg-info/dependency_links.txt 17 | Bishop.egg-info/not-zip-safe 18 | Bishop.egg-info/requires.txt 19 | Bishop.egg-info/top_level.txt 20 | Bishop/Examples/.DS_Store 21 | Bishop/Examples/DetailedInference.py 22 | Bishop/Examples/SimpleInference.py 23 | Bishop/Examples/SimulateAgents.py 24 | Bishop/Fonts/.DS_Store 25 | Bishop/Fonts/estre.ttf 26 | Bishop/Maps/.DS_Store 27 | Bishop/Maps/BayesBookExampleMaps/CRInference_base 28 | Bishop/Maps/BayesBookExampleMaps/CRInference_base.ini 29 | Bishop/Maps/BayesBookExampleMaps/GoalInference_base 30 | Bishop/Maps/BayesBookExampleMaps/GoalInference_base.ini 31 | Bishop/Maps/ControlFlagMaps/.DS_Store 32 | Bishop/Maps/ControlFlagMaps/Flag_Asym_OneR_Dist_FC.ini 33 | Bishop/Maps/ControlFlagMaps/Flag_Asym_OneR_Dist_FR.ini 34 | Bishop/Maps/ControlFlagMaps/Flag_Asym_OneR_FC.ini 35 | Bishop/Maps/ControlFlagMaps/Flag_Asym_OneR_FR.ini 36 | Bishop/Maps/ControlFlagMaps/Flag_Asym_TwoR_Dist_FC.ini 37 | Bishop/Maps/ControlFlagMaps/Flag_Asym_TwoR_Dist_FR.ini 38 | Bishop/Maps/ControlFlagMaps/Flag_Asym_TwoR_FC.ini 39 | Bishop/Maps/ControlFlagMaps/Flag_Asym_TwoR_FR.ini 40 | Bishop/Maps/ControlFlagMaps/Flag_Sym_TwoR_Dist_FC.ini 41 | Bishop/Maps/ControlFlagMaps/Flag_Sym_TwoR_Dist_FR.ini 42 | Bishop/Maps/ControlFlagMaps/Flag_Sym_TwoR_FC.ini 43 | Bishop/Maps/ControlFlagMaps/Flag_Sym_TwoR_FR.ini 44 | Bishop/Maps/ControlFlagMaps/LongFlag_Asymmetric 45 | Bishop/Maps/ControlFlagMaps/LongFlag_Symmetric 46 | Bishop/Maps/ControlFlagMaps/LongFlag_Symmetric_FC 47 | Bishop/Maps/FlagMaps/.DS_Store 48 | Bishop/Maps/FlagMaps/Flag_Asym_OneR.ini 49 | Bishop/Maps/FlagMaps/Flag_Asym_OneRB.ini 50 | Bishop/Maps/FlagMaps/Flag_Asym_OneR_Dist.ini 51 | Bishop/Maps/FlagMaps/Flag_Asym_OneR_DistB.ini 52 | Bishop/Maps/FlagMaps/Flag_Asym_TwoR.ini 53 | Bishop/Maps/FlagMaps/Flag_Asym_TwoRB.ini 54 | Bishop/Maps/FlagMaps/Flag_Asym_TwoR_Dist.ini 55 | Bishop/Maps/FlagMaps/Flag_Asym_TwoR_DistB.ini 56 | Bishop/Maps/FlagMaps/Flag_Asym_TwoR_DistInv.ini 57 | Bishop/Maps/FlagMaps/Flag_Asym_TwoR_InvertedR.ini 58 | Bishop/Maps/FlagMaps/Flag_Map 59 | Bishop/Maps/FlagMaps/Flag_Sym_OneR.ini 60 | Bishop/Maps/FlagMaps/Flag_Sym_OneRB.ini 61 | Bishop/Maps/FlagMaps/Flag_Sym_OneR_Dist.ini 62 | Bishop/Maps/FlagMaps/Flag_Sym_OneR_DistB.ini 63 | Bishop/Maps/FlagMaps/Flag_Sym_TwoR.ini 64 | Bishop/Maps/FlagMaps/Flag_Sym_TwoRB.ini 65 | Bishop/Maps/FlagMaps/Flag_Sym_TwoR_Dist.ini 66 | Bishop/Maps/FlagMaps/Flag_Sym_TwoR_DistB.ini 67 | Bishop/Maps/FlagMaps/LongFlag_Asymmetric 68 | Bishop/Maps/FlagMaps/LongFlag_AsymmetricB 69 | Bishop/Maps/FlagMaps/LongFlag_Symmetric 70 | Bishop/Maps/FlagMaps/LongFlag_SymmetricB 71 | Bishop/Maps/HallwaysMaps/.DS_Store 72 | Bishop/Maps/HallwaysMaps/Hallways_CI_RI.ini 73 | Bishop/Maps/HallwaysMaps/Hallways_CI_RK.ini 74 | Bishop/Maps/HallwaysMaps/Hallways_CK_RI.ini 75 | Bishop/Maps/HallwaysMaps/Hallways_CK_RK.ini 76 | Bishop/Maps/HallwaysMaps/Hallways_base 77 | Bishop/Maps/HallwaysMaps/Hallways_base.ini 78 | Bishop/Maps/HallwaysMaps/Hallways_base_prior.ini 79 | Bishop/Maps/HallwaysMaps/Hallways_invRewards.ini 80 | Bishop/Maps/HallwaysMaps/Hallways_inv_CK_RK.ini 81 | Bishop/Maps/MoralWorld/.DS_Store 82 | Bishop/Maps/MoralWorld/MoralWorld 83 | Bishop/Maps/MoralWorld/MoralWorldLarge_FC.ini 84 | Bishop/Maps/MoralWorld/MoralWorldLarge_FE.ini 85 | Bishop/Maps/MoralWorld/MoralWorldLarge_SC.ini 86 | Bishop/Maps/MoralWorld/MoralWorldLarge_SE.ini 87 | Bishop/Maps/MoralWorld/MoralWorld_FC.ini 88 | Bishop/Maps/MoralWorld/MoralWorld_FE.ini 89 | Bishop/Maps/MoralWorld/MoralWorld_Large 90 | Bishop/Maps/MoralWorld/MoralWorld_SC.ini 91 | Bishop/Maps/MoralWorld/MoralWorld_SE.ini 92 | Bishop/Maps/OneGoalExample/OneGoal_Example 93 | Bishop/Maps/OneGoalExample/OneGoal_Example.ini 94 | Bishop/Maps/OneGoalExample/TwoGoal_Example 95 | Bishop/Maps/OneGoalExample/TwoGoal_Exampley.ini 96 | Bishop/Maps/PondAlternativeModels/P_OT_ORC_FC.ini 97 | Bishop/Maps/PondAlternativeModels/P_OT_ORC_FR.ini 98 | Bishop/Maps/PondAlternativeModels/P_OT_ORE_FC.ini 99 | Bishop/Maps/PondAlternativeModels/P_OT_ORE_FR.ini 100 | Bishop/Maps/PondAlternativeModels/P_OT_TRC_FC.ini 101 | Bishop/Maps/PondAlternativeModels/P_OT_TRC_FR.ini 102 | Bishop/Maps/PondAlternativeModels/P_OT_TRE_FC.ini 103 | Bishop/Maps/PondAlternativeModels/P_OT_TRE_FR.ini 104 | Bishop/Maps/PondAlternativeModels/P_TT_ORC_FC.ini 105 | Bishop/Maps/PondAlternativeModels/P_TT_ORC_FR.ini 106 | Bishop/Maps/PondAlternativeModels/P_TT_ORE_FC.ini 107 | Bishop/Maps/PondAlternativeModels/P_TT_ORE_FR.ini 108 | Bishop/Maps/PondAlternativeModels/P_TT_TRC_FC.ini 109 | Bishop/Maps/PondAlternativeModels/P_TT_TRC_FR.ini 110 | Bishop/Maps/PondAlternativeModels/P_TT_TRE_FC.ini 111 | Bishop/Maps/PondAlternativeModels/P_TT_TRE_FR.ini 112 | Bishop/Maps/PondAlternativeModels/Pond_OT 113 | Bishop/Maps/PondAlternativeModels/Pond_TT 114 | Bishop/Maps/PondMaps2Agents/.DS_Store 115 | Bishop/Maps/PondMaps2Agents/P_Org_OT_ORE_2Ag.ini 116 | Bishop/Maps/PondMaps2Agents/P_Org_OT_TRC_2Ag.ini 117 | Bishop/Maps/PondMaps2Agents/P_Org_OT_TRE_2Ag.ini 118 | Bishop/Maps/PondMaps2Agents/P_Org_TT_ORC_2Ag.ini 119 | Bishop/Maps/PondMaps2Agents/P_Org_TT_ORE_2Ag.ini 120 | Bishop/Maps/PondMaps2Agents/P_Org_TT_TRC_2Ag.ini 121 | Bishop/Maps/PondMaps2Agents/P_Org_TT_TRE_2Ag.ini 122 | Bishop/Maps/PondMaps2Agents/Pond_OT 123 | Bishop/Maps/PondMaps2Agents/Pond_TT 124 | Bishop/Maps/PondMapsObjectAgent/.DS_Store 125 | Bishop/Maps/PondMapsObjectAgent/P_OT_ORT_1Ob_AT.ini 126 | Bishop/Maps/PondMapsObjectAgent/P_OT_TRC_2Ob_AB.ini 127 | Bishop/Maps/PondMapsObjectAgent/P_OT_TRC_2Ob_AT.ini 128 | Bishop/Maps/PondMapsObjectAgent/P_OT_TRE_2Ob_AB.ini 129 | Bishop/Maps/PondMapsObjectAgent/P_OT_TRE_2Ob_AT.ini 130 | Bishop/Maps/PondMapsObjectAgent/P_Org_OT_ORT_1Ob_AT.ini 131 | Bishop/Maps/PondMapsObjectAgent/P_Org_OT_TRC_2Ob_AB.ini 132 | Bishop/Maps/PondMapsObjectAgent/P_Org_OT_TRC_2Ob_AT.ini 133 | Bishop/Maps/PondMapsObjectAgent/P_Org_OT_TRE_2Ob_AB.ini 134 | Bishop/Maps/PondMapsObjectAgent/P_Org_OT_TRE_2Ob_AT.ini 135 | Bishop/Maps/PondMapsObjectAgent/P_Org_TT_ORC_1Ob_AC.ini 136 | Bishop/Maps/PondMapsObjectAgent/P_Org_TT_ORC_1Ob_AT.ini 137 | Bishop/Maps/PondMapsObjectAgent/P_Org_TT_TRC_2Ob_AB.ini 138 | Bishop/Maps/PondMapsObjectAgent/P_Org_TT_TRC_2Ob_AT.ini 139 | Bishop/Maps/PondMapsObjectAgent/P_Org_TT_TRE_2Ob_AB.ini 140 | Bishop/Maps/PondMapsObjectAgent/P_Org_TT_TRE_2Ob_AT.ini 141 | Bishop/Maps/PondMapsObjectAgent/P_TT_ORC_1Ob_AC.ini 142 | Bishop/Maps/PondMapsObjectAgent/P_TT_ORC_1Ob_AT.ini 143 | Bishop/Maps/PondMapsObjectAgent/P_TT_TRC_2Ob_AB.ini 144 | Bishop/Maps/PondMapsObjectAgent/P_TT_TRC_2Ob_AT.ini 145 | Bishop/Maps/PondMapsObjectAgent/P_TT_TRE_2Ob_AB.ini 146 | Bishop/Maps/PondMapsObjectAgent/P_TT_TRE_2Ob_AT.ini 147 | Bishop/Maps/PondMapsObjectAgent/Pond_OT 148 | Bishop/Maps/PondMapsObjectAgent/Pond_TT 149 | Bishop/Maps/PondMapsOneObjCap/.DS_Store 150 | Bishop/Maps/PondMapsOneObjCap/P_OT.ini 151 | Bishop/Maps/PondMapsOneObjCap/P_OT_ORC.ini 152 | Bishop/Maps/PondMapsOneObjCap/P_OT_ORE.ini 153 | Bishop/Maps/PondMapsOneObjCap/P_OT_TRC.ini 154 | Bishop/Maps/PondMapsOneObjCap/P_OT_TRE.ini 155 | Bishop/Maps/PondMapsOneObjCap/P_TT.ini 156 | Bishop/Maps/PondMapsOneObjCap/P_TT_ORC.ini 157 | Bishop/Maps/PondMapsOneObjCap/P_TT_ORE.ini 158 | Bishop/Maps/PondMapsOneObjCap/P_TT_TRC.ini 159 | Bishop/Maps/PondMapsOneObjCap/P_TT_TRE.ini 160 | Bishop/Maps/PondMapsOneObjCap/Pond_OT 161 | Bishop/Maps/PondMapsOneObjCap/Pond_TT 162 | Bishop/Maps/PondMapsTwoObjs/.DS_Store 163 | Bishop/Maps/PondMapsTwoObjs/P_OT_TRC_2Ob.ini 164 | Bishop/Maps/PondMapsTwoObjs/P_OT_TRE_2Ob.ini 165 | Bishop/Maps/PondMapsTwoObjs/P_TT_TRC_2Ob.ini 166 | Bishop/Maps/PondMapsTwoObjs/P_TT_TRE_2Ob.ini 167 | Bishop/Maps/PondMapsTwoObjs/Pond_OT 168 | Bishop/Maps/PondMapsTwoObjs/Pond_TT 169 | Bishop/Maps/PredictionControlMaps/.DS_Store 170 | Bishop/Maps/PredictionControlMaps/Prediction_RFlip_TFlip_control.ini 171 | Bishop/Maps/PredictionControlMaps/Prediction_RFlip_TKeep_control.ini 172 | Bishop/Maps/PredictionControlMaps/Prediction_RFlip_TLeft_control.ini 173 | Bishop/Maps/PredictionControlMaps/Prediction_RFlip_TRight_control.ini 174 | Bishop/Maps/PredictionControlMaps/Prediction_RKeep_TFlip_control.ini 175 | Bishop/Maps/PredictionControlMaps/Prediction_RKeep_TKeep_control.ini 176 | Bishop/Maps/PredictionControlMaps/Prediction_RKeep_TLeft_control.ini 177 | Bishop/Maps/PredictionControlMaps/Prediction_RKeep_TRight_control.ini 178 | Bishop/Maps/PredictionControlMaps/Prediction_RLeft_TFlip_control.ini 179 | Bishop/Maps/PredictionControlMaps/Prediction_RLeft_TKeep_control.ini 180 | Bishop/Maps/PredictionControlMaps/Prediction_RLeft_TLeft_control.ini 181 | Bishop/Maps/PredictionControlMaps/Prediction_RLeft_TRight_control.ini 182 | Bishop/Maps/PredictionControlMaps/Prediction_RRight_TFlip_control.ini 183 | Bishop/Maps/PredictionControlMaps/Prediction_RRight_TKeep_control.ini 184 | Bishop/Maps/PredictionControlMaps/Prediction_RRight_TLeft_control.ini 185 | Bishop/Maps/PredictionControlMaps/Prediction_RRight_TRight_control.ini 186 | Bishop/Maps/PredictionControlMaps/Prediction_base_control 187 | Bishop/Maps/PredictionControlMaps/Prediction_base_control.ini 188 | Bishop/Maps/PredictionTaskMaps/.DS_Store 189 | Bishop/Maps/PredictionTaskMaps/Prediction_RFlip_TFlip.ini 190 | Bishop/Maps/PredictionTaskMaps/Prediction_RFlip_TKeep.ini 191 | Bishop/Maps/PredictionTaskMaps/Prediction_RFlip_TLeft.ini 192 | Bishop/Maps/PredictionTaskMaps/Prediction_RFlip_TRight.ini 193 | Bishop/Maps/PredictionTaskMaps/Prediction_RKeep_TFlip.ini 194 | Bishop/Maps/PredictionTaskMaps/Prediction_RKeep_TKeep.ini 195 | Bishop/Maps/PredictionTaskMaps/Prediction_RKeep_TLeft.ini 196 | Bishop/Maps/PredictionTaskMaps/Prediction_RKeep_TRight.ini 197 | Bishop/Maps/PredictionTaskMaps/Prediction_RLeft_TFlip.ini 198 | Bishop/Maps/PredictionTaskMaps/Prediction_RLeft_TKeep.ini 199 | Bishop/Maps/PredictionTaskMaps/Prediction_RLeft_TLeft.ini 200 | Bishop/Maps/PredictionTaskMaps/Prediction_RLeft_TRight.ini 201 | Bishop/Maps/PredictionTaskMaps/Prediction_RRight_TFlip.ini 202 | Bishop/Maps/PredictionTaskMaps/Prediction_RRight_TKeep.ini 203 | Bishop/Maps/PredictionTaskMaps/Prediction_RRight_TLeft.ini 204 | Bishop/Maps/PredictionTaskMaps/Prediction_RRight_TRight.ini 205 | Bishop/Maps/PredictionTaskMaps/Prediction_base 206 | Bishop/Maps/PredictionTaskMaps/Prediction_base.ini 207 | Bishop/Maps/PredictionTaskMaps/Prediction_terrainflip 208 | Bishop/Maps/PredictionTaskMaps/Prediction_terrainleftuniform 209 | Bishop/Maps/PredictionTaskMaps/Prediction_terrainrightuniform 210 | Bishop/Maps/RecombinationMaps/.DS_Store 211 | Bishop/Maps/RecombinationMaps/LongFlag_Asymmetric 212 | Bishop/Maps/RecombinationMaps/Recomb_RewardFlip.ini 213 | Bishop/Maps/RecombinationMaps/Recomb_TerrainFlip.ini 214 | Bishop/Maps/RecombinationMaps/Recomb_TerrainRewardFlip.ini 215 | Bishop/Maps/RecombinationMaps/Recomb_base 216 | Bishop/Maps/RecombinationMaps/Recomb_base.ini 217 | Bishop/Maps/RecombinationMaps/Recomb_inverse 218 | Bishop/Maps/ShoreMaps/Shore_Map 219 | Bishop/Maps/ShoreMaps/Shore_RO_EO.ini 220 | Bishop/Maps/ShoreMaps/Shore_RO_ES.ini 221 | Bishop/Maps/ShoreMaps/Shore_RS_EO.ini 222 | Bishop/Maps/ShoreMaps/Shore_RS_ES.ini 223 | Bishop/Maps/ShoreMaps_Long/LongShore_Map 224 | Bishop/Maps/ShoreMaps_Long/LongShore_ROC.ini 225 | Bishop/Maps/ShoreMaps_Long/LongShore_ROF.ini 226 | Bishop/Maps/ShoreMaps_Long/LongShore_RO_EO.ini 227 | Bishop/Maps/ShoreMaps_Long/LongShore_RO_ES.ini 228 | Bishop/Maps/ShoreMaps_Long/LongShore_RSC.ini 229 | Bishop/Maps/ShoreMaps_Long/LongShore_RSF.ini 230 | Bishop/Maps/ShoreMaps_Long/LongShore_RS_EO.ini 231 | Bishop/Maps/ShoreMaps_Long/LongShore_RS_ES.ini 232 | Bishop/Maps/SimpleGoalMap/SimpleGoalMap.ini 233 | Bishop/Maps/SimpleGoalMap/SimpleMap 234 | bin/Bishop -------------------------------------------------------------------------------- /Bishop/AuxiliaryFunctions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | Supporting functions for Bishop 5 | """ 6 | 7 | import configparser 8 | import os 9 | import sys 10 | import pickle 11 | import pkg_resources 12 | import copy 13 | from . import Observer 14 | from . import PosteriorContainer 15 | from . import Map 16 | from . import Agent 17 | 18 | 19 | def ProbabilityOfChange(ContA, ContB, TestVariable, Tolerance=None): 20 | """ 21 | Compute the probability that TestVariable is different across containers. 22 | This function is meant to be piped with Observer.UpdateExperience() (Observer.ComputeProbabilityOfChange() does this). 23 | 24 | Args: 25 | ContainerA (PosteriorContainer): PosteriorContainer object 26 | ContainerB (PosteriorContainer): PosteriorContainer object 27 | TestVariable (string): Random variable to test. Must exist in both containers 28 | Tolerance (float): When different that None, Tolerance determines how many floating 29 | points to leave in samples. Thus, if tolerance=1, the function returns the probability that 30 | TestVariable is larger than .1 31 | 32 | Returns [ProbabilitySame, ProbabilityDifferent] 33 | """ 34 | # Condtitioning is already accounted. So now just add the different 35 | # probabilities: 36 | P_Same = 0 37 | P_Diff = 0 38 | if Tolerance is not None: 39 | # If tolerance is set make a deep copy of containers and round them 40 | ContainerA = copy.deepcopy(ContA) 41 | ContainerB = copy.deepcopy(ContB) 42 | ContainerA.CostSamples = np.round(ContainerA.CostSamples, Tolerance) 43 | ContainerB.CostSamples = np.round(ContainerB.CostSamples, Tolerance) 44 | ContainerA.RewardSamples = np.round( 45 | ContainerA.RewardSamples, Tolerance) 46 | ContainerB.RewardSamples = np.round( 47 | ContainerB.RewardSamples, Tolerance) 48 | else: 49 | # Otherwise you can just use the original objects 50 | ContainerA = ContA 51 | ContainerB = ContB 52 | # Locate test variable and save its index 53 | if TestVariable in ContainerA.ObjectNames: 54 | IndexA = ContainerA.ObjectNames.index(TestVariable) 55 | IndexB = ContainerB.ObjectNames.index(TestVariable) 56 | TestLocation = "Objects" 57 | else: 58 | IndexA = ContainerA.CostNames.index(TestVariable) 59 | IndexB = ContainerB.CostNames.index(TestVariable) 60 | TestLocation = "Terrains" 61 | for i in range(ContainerA.Samples): 62 | Prob = np.exp(ContainerA.LogLikelihoods[i]) * \ 63 | np.exp(ContainerB.LogLikelihoods[i]) 64 | if Prob > 0: 65 | if TestLocation == "Objects": 66 | if ContainerA.RewardSamples[i, IndexA] == ContainerB.RewardSamples[i, IndexB]: 67 | #sys.stdout.write("Sample " + str(i) + " matches\n") 68 | P_Same += Prob 69 | else: 70 | #sys.stdout.write("Sample " + str(i) + " doesn't match\n") 71 | P_Diff += Prob 72 | else: 73 | if ContainerA.CostSamples[i, IndexA] == ContainerB.CostSamples[i, IndexB]: 74 | #sys.stdout.write("Sample " + str(i) + " matches\n") 75 | P_Same += Prob 76 | else: 77 | #sys.stdout.write("Sample " + str(i) + " doesn't match\n") 78 | P_Diff += Prob 79 | return [P_Same, P_Diff] 80 | 81 | 82 | def SaveSamples(Container, Name): 83 | """ 84 | Save object as a pickle file. 85 | 86 | Args: 87 | Container (PosteriorContainer): PosteriorContainer object 88 | Name (string): Filename. Function adds ".p" extension if it's not provided 89 | """ 90 | try: 91 | if Name[-2:] != ".p": 92 | Name = Name + ".p" 93 | pickle.dump(Container, open(Name, "wb")) 94 | except Exception as error: 95 | print(error) 96 | 97 | 98 | def LoadSamples(FileName): 99 | """ 100 | Load samples from a pickle file 101 | 102 | Args: 103 | FileName (str): filename 104 | 105 | returns: 106 | Samples 107 | """ 108 | try: 109 | Samples = pickle.load(open(FileName, "rb")) 110 | return Samples 111 | except Exception as error: 112 | print(error) 113 | 114 | 115 | def AnalyzeSamples(FileName): 116 | """ 117 | Print sample summary from a pickle file 118 | 119 | Args: 120 | FileName (str): filename 121 | """ 122 | try: 123 | Samples = pickle.load(open(FileName, "rb")) 124 | Samples.LongSummary() 125 | except Exception as error: 126 | print(error) 127 | 128 | 129 | def LoadObserverFromPC(PostCont): 130 | """ 131 | Load observer object from a PosteriorContainer object. 132 | 133 | Args: 134 | Postcont (PosteriorContainer): Posterior container object 135 | 136 | Returns: 137 | Observer object 138 | """ 139 | if PostCont.MapFile is None: 140 | print("No map associated with samples. Cannot load observer.") 141 | return None 142 | else: 143 | try: 144 | Obs = LoadObserver(PostCont.MapFile, False, True) 145 | Obs.SetStartingPoint(PostCont.StartingPoint, False) 146 | Obs.PrintMap() 147 | return Obs 148 | except Exception as error: 149 | print(error) 150 | 151 | 152 | def GetMapList(CurrDir): 153 | """ 154 | Get list of map files in a directory. 155 | 156 | Args: 157 | CurrDir (str): Search directory. 158 | 159 | Returns: 160 | files (list): List of files.å 161 | """ 162 | files = [] 163 | for File in os.listdir(CurrDir): 164 | # Check if it's a file 165 | if File.endswith(".ini"): 166 | files.append(File) 167 | return files 168 | 169 | 170 | def ShowAvailableMaps(Match=""): 171 | """ 172 | Print list of maps in Bishop library. 173 | 174 | Args: 175 | Match (String): Only print maps that contain string. 176 | """ 177 | # Create an empty dictionary. 178 | results = {} 179 | BaseDirectory = os.path.dirname(__file__) + "/Maps/" 180 | # stdout.write(BaseDirectory) 181 | Files = GetMapList(BaseDirectory) 182 | if Files != []: 183 | results['Bishop main maps'] = Files 184 | for Item in os.listdir(BaseDirectory): 185 | TempDir = os.path.join(BaseDirectory, Item) 186 | if os.path.isdir(TempDir): 187 | # Add to dictionary 188 | Files = GetMapList(TempDir) 189 | if Files != []: 190 | results[Item] = GetMapList(TempDir) 191 | # print maps 192 | for key in results: 193 | HasPrinted = False 194 | for i in results[key]: 195 | if Match in i: 196 | if not HasPrinted: 197 | sys.stdout.write(key + ":\n") 198 | HasPrinted = True 199 | sys.stdout.write("\t" + i + "\n") 200 | sys.stdout.write("\n") 201 | 202 | 203 | def LocateFile(CurrDir, filename): 204 | """ 205 | Search for file recursively. 206 | 207 | Args: 208 | CurrDir (str): Search directory 209 | filename (str): filename 210 | 211 | Returns: 212 | dir (str): Location of the file (if found; None otherwise) 213 | """ 214 | for Currfile in os.listdir(CurrDir): 215 | test = os.path.join(CurrDir, Currfile) 216 | if os.path.isdir(test): 217 | res = LocateFile(test, filename) 218 | if res is not None: 219 | return res 220 | else: 221 | # it's a file 222 | if Currfile == filename: 223 | return CurrDir 224 | 225 | 226 | def LoadObserver(MapConfig, Silent=False): 227 | """ 228 | Load a map. If map isn't found in Bishop's library the 229 | function searches for the map in your working directory. 230 | 231 | Args: 232 | MapConfig (str): Name of map to load 233 | Silent (bool): If false then function doesn't print map. 234 | 235 | Returns: 236 | Observer object 237 | """ 238 | try: 239 | Local = False 240 | Config = configparser.ConfigParser() 241 | FilePath = os.path.dirname(__file__) + "/Maps/" 242 | FilePath = LocateFile(FilePath, MapConfig + ".ini") 243 | if FilePath is not None: 244 | FilePath = FilePath + "/" + MapConfig + ".ini" 245 | ######################### 246 | ## Load .ini map first ## 247 | ######################### 248 | else: 249 | print("Map not in library. Checking local directory...") 250 | FilePath = MapConfig + ".ini" 251 | Local = True 252 | if not os.path.isfile(FilePath): 253 | print("ERROR: Map not found.") 254 | return None 255 | Config.read(FilePath) 256 | except Exception as error: 257 | print(error) 258 | 259 | # Agent parameter section 260 | ######################### 261 | if not Config.has_section("AgentParameters"): 262 | print("ERROR: AgentParameters block missing.") 263 | return None 264 | if Config.has_option("AgentParameters", "Method"): 265 | temp = Config.get("AgentParameters", "Method") 266 | if temp == 'Linear' or temp == 'Rate': 267 | Method = temp 268 | else: 269 | if not Silent: 270 | if temp == 'Discount': 271 | print( 272 | "Discount method is now integrated with the linear utility method (2.6+). Use organic markers to mark discounts.") 273 | else: 274 | print( 275 | "ERROR: Unknown utility type. Using a linear utility function.") 276 | Method = "Linear" 277 | else: 278 | if not Silent: 279 | print("Using a linear utility function (Add a Method in the AgentParameters block to change to 'Rate' utilities).") 280 | Method = "Linear" 281 | if Config.has_option("AgentParameters", "Prior"): 282 | CostPrior = Config.get("AgentParameters", "Prior") 283 | RewardPrior = CostPrior 284 | else: 285 | if Config.has_option("AgentParameters", "CostPrior"): 286 | CostPrior = Config.get("AgentParameters", "CostPrior") 287 | else: 288 | print( 289 | "WARNING: No cost prior specified in AgentParameters. Use Agent.Priors() to see list of priors") 290 | return None 291 | if Config.has_option("AgentParameters", "RewardPrior"): 292 | RewardPrior = Config.get("AgentParameters", "RewardPrior") 293 | else: 294 | print("WARNING: No reward prior specified in AgentParameters. Use Agent.Priors() to see list of priors") 295 | return None 296 | if Config.has_option("AgentParameters", "Minimum"): 297 | Minimum = Config.getint("AgentParameters", "Minimum") 298 | else: 299 | Minimum = 0 300 | if Config.has_option("AgentParameters", "Capacity"): 301 | Capacity = Config.getint("AgentParameters", "Capacity") 302 | else: 303 | Capacity = -1 304 | if Capacity != -1 and Minimum > Capacity: 305 | sys.stdout.write( 306 | "ERROR: Agent's minimum number of elements exceed capacity.") 307 | return None 308 | if Config.has_option("AgentParameters", "Restrict"): 309 | Restrict = Config.getboolean("AgentParameters", "Restrict") 310 | else: 311 | if not Silent: 312 | print( 313 | "Setting restrict to false (i.e., uncertainty over which terrain is the easiest)") 314 | Restrict = False 315 | if Config.has_option("AgentParameters", "SoftmaxChoice"): 316 | SoftmaxChoice = Config.getboolean("AgentParameters", "SoftmaxChoice") 317 | else: 318 | print("Softmaxing choices") 319 | SoftmaxChoice = True 320 | if Config.has_option("AgentParameters", "SoftmaxAction"): 321 | SoftmaxAction = Config.getboolean("AgentParameters", "SoftmaxAction") 322 | else: 323 | print("Softmaxing actions") 324 | SoftmaxAction = True 325 | if Config.has_option("AgentParameters", "choiceTau"): 326 | choiceTau = Config.getfloat("AgentParameters", "choiceTau") 327 | else: 328 | if SoftmaxChoice: 329 | print("Setting choice softmax to 0.01") 330 | choiceTau = 0.01 331 | else: 332 | # Doesn't matter; won't be used. 333 | choiceTau = 0 334 | if Config.has_option("AgentParameters", "actionTau"): 335 | actionTau = Config.getfloat("AgentParameters", "actionTau") 336 | else: 337 | if SoftmaxAction: 338 | print("Setting action softmax to 0.01") 339 | actionTau = 0.01 340 | else: 341 | # Doesn't matter; won't be used. 342 | actionTau = 0 343 | if Config.has_option("AgentParameters", "CostParameters"): 344 | CostParameters = Config.get("AgentParameters", "CostParameters") 345 | CostParameters = CostParameters.split() 346 | CostParameters = [float(i) for i in CostParameters] 347 | else: 348 | print("ERROR: Missing cost parameters for prior sampling in AgentParameters block.") 349 | return None 350 | if Config.has_option("AgentParameters", "RewardParameters"): 351 | RewardParameters = Config.get("AgentParameters", "RewardParameters") 352 | RewardParameters = [float(i) for i in RewardParameters.split()] 353 | else: 354 | print("ERROR: Missing cost parameters for prior sampling in AgentParameters block.") 355 | return None 356 | if Config.has_option("AgentParameters", "PNull"): 357 | CNull = Config.getfloat("AgentParameters", "PNull") 358 | RNull = CNull 359 | else: 360 | if Config.has_option("AgentParameters", "CNull"): 361 | CNull = Config.getfloat("AgentParameters", "CNull") 362 | else: 363 | print("WARNING: No probability of terrains having null cost. Setting to 0.") 364 | CNull = 0 365 | if Config.has_option("AgentParameters", "RNull"): 366 | RNull = Config.getfloat("AgentParameters", "RNull") 367 | else: 368 | print("WARNING: No probability of terrains having null cost. Setting to 0.") 369 | RNull = 0 370 | # Map parameter section 371 | ####################### 372 | if not Config.has_section("MapParameters"): 373 | print("ERROR: MapParameters block missing.") 374 | return None 375 | if Config.has_option("MapParameters", "DiagonalTravel"): 376 | DiagonalTravel = Config.getboolean( 377 | "MapParameters", "DiagonalTravel") 378 | else: 379 | print("Allowing diagonal travel") 380 | DiagonalTravel = True 381 | if Config.has_option("MapParameters", "StartingPoint"): 382 | StartingPoint = Config.getint( 383 | "MapParameters", "StartingPoint") 384 | else: 385 | print("ERROR: Missing starting point in MapParameters block.") 386 | return None 387 | if Config.has_option("MapParameters", "ExitState"): 388 | ExitState = Config.getint( 389 | "MapParameters", "ExitState") 390 | else: 391 | print("ERROR: Missing exit state in MapParameters block.") 392 | return None 393 | try: 394 | if Config.has_option("MapParameters", "MapName"): 395 | MapName = Config.get( 396 | "MapParameters", "MapName") 397 | if not Local: 398 | TerrainPath = os.path.dirname(__file__) + "/Maps/" 399 | TerrainPath = os.path.join( 400 | LocateFile(TerrainPath, MapName), MapName) 401 | else: 402 | TerrainPath = MapName 403 | f = open(TerrainPath, "r") 404 | MapLoad = True 405 | StateTypes = [] 406 | StateNames = [] 407 | mapheight = 0 408 | for line in iter(f): 409 | if MapLoad: 410 | states = [int(i) for i in list(line.rstrip())] 411 | if states == []: 412 | MapLoad = False 413 | else: 414 | mapheight += 1 415 | StateTypes.extend(states) 416 | else: 417 | statename = line.rstrip() 418 | if statename != "": 419 | StateNames.append(statename) 420 | f.close() 421 | mapwidth = int(len(StateTypes) / mapheight) 422 | else: 423 | print("ERROR: Missing map name") 424 | return None 425 | except: 426 | print("ERROR: Cannot load map layout.") 427 | # raise 428 | return None 429 | # Load object information 430 | ######################### 431 | if not Config.has_section("Objects"): 432 | print("ERROR: Objects block missing.") 433 | return None 434 | else: 435 | if Config.has_option("Objects", "ObjectLocations"): 436 | ObjectLocations = Config.get("Objects", "ObjectLocations") 437 | ObjectLocations = [int(i) for i in ObjectLocations.split()] 438 | HasObjects = True 439 | else: 440 | print("WARNING: No objects in map (Agent will always go straight home).") 441 | HasObjects = False 442 | if HasObjects: 443 | if Config.has_option("Objects", "ObjectTypes"): 444 | ObjectTypes = Config.get("Objects", "ObjectTypes") 445 | ObjectTypes = [int(i) for i in ObjectTypes.split()] 446 | if len(ObjectTypes) != len(ObjectLocations): 447 | print( 448 | "Error: ObjectLocations and ObjectTypes should have the same length") 449 | return None 450 | else: 451 | print( 452 | "WARNING: No information about object types. Setting all to same kind.") 453 | ObjectTypes = [0] * len(ObjectLocations) 454 | if Config.has_option("Objects", "ObjectNames"): 455 | ObjectNames = Config.get("Objects", "ObjectNames") 456 | ObjectNames = [str(i) for i in ObjectNames.split()] 457 | else: 458 | ObjectNames = None 459 | if Config.has_option("Objects", "Organic"): 460 | Organic = Config.get("Objects", "Organic") 461 | Organic = [bool(int(i)) for i in Organic.split()] 462 | else: 463 | if not Silent: 464 | print("No organic markers. Treating all objects as dead. Add an Organic line to mark if some object types are agents (add probability of death).") 465 | Organic = [False] * len(ObjectTypes) 466 | if Config.has_option("Objects", "SurvivalProb"): 467 | SurvivalProb = Config.getfloat("Objects", "SurvivalProb") 468 | if sum(Organic) == 0: 469 | print("You specified a survival probability, but there are no organic objects. Model will work but maybe you specified the map incorrectly.") 470 | else: 471 | if sum(Organic) > 0: 472 | print("Map has organic objects but survival probability not specified. Setting to 0.95; change this by adding a Survival parameter on the Objects block.") 473 | SurvivalProb = 0.95 474 | else: 475 | # Just to fit in with Planner constructor. 476 | SurvivalProb = 1 477 | else: 478 | ObjectTypes = [] 479 | ObjectNames = None 480 | # Create objects! 481 | try: 482 | MyMap = Map() 483 | MyMap.BuildGridWorld(mapwidth, mapheight, DiagonalTravel) 484 | if HasObjects: 485 | MyMap.InsertObjects(ObjectLocations, ObjectTypes, 486 | Organic, ObjectNames, SurvivalProb) 487 | MyMap.StateTypes = StateTypes 488 | MyMap.StateNames = StateNames 489 | MyMap.AddStartingPoint(StartingPoint) 490 | MyMap.AddExitState(ExitState) 491 | if not Silent: 492 | sys.stdout.write("\n") 493 | MyMap.PrintMap() 494 | MyAgent = Agent(MyMap, CostPrior, RewardPrior, CostParameters, RewardParameters, Capacity, 495 | Minimum, SoftmaxChoice, SoftmaxAction, choiceTau, actionTau, CNull, RNull, Restrict) 496 | return Observer.Observer(MyAgent, MyMap, Method) 497 | except Exception as error: 498 | print(error) 499 | --------------------------------------------------------------------------------