1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-09-19 19:01:17 +00:00

Fix reward_discount_analysis

This commit is contained in:
Mo8it 2022-04-06 17:07:04 +02:00
parent a2262bce9e
commit ea420224f9
2 changed files with 5 additions and 5 deletions

View file

@ -4,10 +4,10 @@ using PrettyTables: pretty_table
using ReCo: ReCo using ReCo: ReCo
function latex_table( function latex_table(
dataframe::DataFrames.DataFrame, filename::String; path::String = "exports/$filename" dataframe::DataFrames.DataFrame, filename::String; path::String="exports/$filename"
) )
open(path, "w") do f open(path, "w") do f
pretty_table(f, dataframe; backend = :latex, nosubheader = true, alignment = :c) pretty_table(f, dataframe; backend=:latex, nosubheader=true, alignment=:c)
end end
return nothing return nothing
@ -29,7 +29,7 @@ function export_q_matrix(env_helper::ReCo.RL.EnvHelper, filename_without_extensi
table[:, col] ./= sum(table[:, col]) table[:, col] ./= sum(table[:, col])
end end
table .= round.(table, digits = 2) table .= round.(table, digits=2)
state_spaces_labels = env_helper.shared.env.shared.state_spaces_labels state_spaces_labels = env_helper.shared.env.shared.state_spaces_labels
states = AbstractString[] states = AbstractString[]

View file

@ -11,8 +11,8 @@ function run_reward_discount_processes(γs::AbstractVector)
Threads.@threads for γ_ind in 1:n_γs Threads.@threads for γ_ind in 1:n_γs
γ = γs[γ_ind] γ = γs[γ_ind]
env_helper, rl_dir = ReCo.run_rl(; env_helper, rl_dir = ReCo.run_rl(
EnvType=ReCo.OriginEnv, ReCo.OriginEnv;
n_episodes=400, n_episodes=400,
episode_duration=15.0, episode_duration=15.0,
n_particles=150, n_particles=150,