Run make
and open index.html to play with stuff.
Make lets you compile different models together!
modelHarness.wppl
implements functionality that's common to all models like action choosing(act
), simulation(simulate
), state guessing for players, utility and player switching.modelAnalysis.wppl
provides analysis methods, all wrapped in ananalyzeState(state)
method that visualizes various decisions and outcomes for both players when starting from the given statecommands.wppl
is the final file that lets you specify which states you want to analyzetraffic.wppl
is the basic model file. All models need to implement the following:- Constants:
defaultDepth
:int
that defines how many steps into the future the agents look when decidingactExecutions
:int
that determines how many executions the enumerative inference runs when inferring action choicesimulateExecutions:
int` that determines how many executions the enumerative inference runs when inferring simulation outcomes
- Methods:
pedPrior(state)
: function that return a distribution over the pedestrian's action given a statecarPrior(state)
: function that returns a distribution over the car's action given a statetransition(state, move, player)
: function that transitions a given state to the new state given the specified player's actioncrashed(state)
: returns true if a crash happened in the given statecarReward(state)
: returns the reward the car gets if this is the terminal statepedReward(state)
: returns the reward the ped gets if this is the terminal stateisTerminal(state)
: returns whether the state is terminalguessCarState(state)
: returns the pedestrian's guess of the full state (can return the same state if all information is global, otherwise pedestrian has to randomly guess a specific state given its information)guessPedState(state)
: returns the car's guess of the full state (can return the same state if all information is global, otherwise car has to randomly guess a specific state given its information)
- Constants: