Skip to content

Commit

Permalink
made distributions consistent for Circular Corridors
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingWorkshop committed Jun 24, 2024
1 parent 31b4e6c commit 0672139
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/envs/circular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function _make_probabilities(corridor_length)
max_ = maximum(d)
step_size = (max_ - min_) / corridor_length
probabilities = []
for x1 in min_:step_size:max_
for x1 in min_:step_size:(max_ - 1)
x2 = x1 + step_size
m = _get_mass(d, x1, x2)
push!(probabilities, m)
Expand Down Expand Up @@ -124,7 +124,7 @@ function _center_probabilities(pomdp::CircularMaze, x::Integer)
end

# observations identify the current state modulo 100 with a mean equal to the true state s.x (modulo 100)
function POMDPs.observation(pomdp::CircularMaze, s::CircularMazeState, a::Integer, sp::CircularMazeState)
function POMDPs.observation(pomdp::CircularMaze, s::CircularMazeState, a::Integer, ::CircularMazeState)
if a == CMAZE_SENSE_CORRIDOR
obs = Deterministic(s.corridor)
else
Expand All @@ -139,6 +139,10 @@ function POMDPs.observation(pomdp::CircularMaze, s::CircularMazeState, a::Intege
return obs
end

function POMDPs.observation(pomdp::CircularMaze, s::TerminalState)
return Deterministic(terminalstate)
end

function POMDPs.observations(pomdp::CircularMaze)
corridors = 1:pomdp.n_corridors
space = IterTools.chain(states(pomdp), corridors)
Expand Down

0 comments on commit 0672139

Please sign in to comment.