Skip to content

Commit

Permalink
move connect_action_selection! dispatches to src/blox/RL
Browse files Browse the repository at this point in the history
  • Loading branch information
harisorgn committed Dec 16, 2024
1 parent 37bc2ea commit 5104b3d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/blox/reinforcement_learning.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ function (p::GreedyPolicy)(sol::SciMLBase.AbstractSciMLSolution)
return argmax(comp_vals)
end

function connect_action_selection!(as::AbstractActionSelection, str1::Striatum, str2::Striatum)
connect_action_selection!(as, get_matrisome(str1), get_matrisome(str2))
end

function connect_action_selection!(as::AbstractActionSelection, matr1::Matrisome, matr2::Matrisome)
sys1 = get_namespaced_sys(matr1)
sys2 = get_namespaced_sys(matr2)

as.competitor_states = [sys1.ρ_, sys2.ρ_] #HACK : accessing values of rho at a specific time after the simulation
#as.competitor_params = [sys1.H, sys2.H]
end

get_eval_times(gp::GreedyPolicy) = [gp.t_decision]

get_eval_states(gp::GreedyPolicy) = gp.competitor_states
Expand Down

0 comments on commit 5104b3d

Please sign in to comment.