Skip to content

Commit

Permalink
add some corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
0x-Inf committed Jun 13, 2024
1 parent bd6800c commit 2b14ef8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
19 changes: 14 additions & 5 deletions src/AlgebraicBellman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GU_BT = Ctrl("b")
BT_GS = Ctrl("c")
GS_GS = Ctrl("d")

function generation_state(n::Int64)
function generation_state(n::Int64) <: Function
if n == 1
B
elseif n == 2
Expand All @@ -61,6 +61,7 @@ function generation_state(n::Int64)
GT
elseif n == 4
GS
end
end

function generation_next(state::State{Int64}, action::Ctrl{String})
Expand All @@ -81,7 +82,7 @@ function generation_next(state::State{Int64}, action::Ctrl{String})
end
end

function generation_policy(state::State{Int64})
function generation_policy(state::State{Int64}) <: Funciton

end

Expand All @@ -91,12 +92,20 @@ end

generation_states = [B, BT, GS, GU]
generation_controls = [B_B, GU_B, GU_GU, GU_BT, BT_GS, GS_GS]
generation_policy = Policy(GU,GU_B)
# generation_policy = Policy(GU,GU_B)


generation_sdp = SDP(3,3,generation_state,generation_states, generation_controls, generation_next, generation_policy,generation_reward)
generation_sdp = SDP{Int64, Int64, Int64, String}(
3,
3,
generation_state,
generation_states,
generation_controls,
generation_next,
generation_policy,
generation_reward)

generation_policy_seq = bi(3,3,generation_sdp)
generation_policy_seq = bi(3,3, generation_sdp)


end
2 changes: 1 addition & 1 deletion src/Bellman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function isBellman()
true
end

function bi(t::Integer, n::Integer, sdp::SDP)
function bi(t::Int64, n::Int64, sdp::SDP)
policySeq = PolicySeq(t,n,[])
policies_in_seq = []
for i in n:-1:1
Expand Down
2 changes: 1 addition & 1 deletion src/SDPCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function reward(current_decision_step::Integer, current_state::State, action_at_
return action_reward
end

mutable struct SDP{T,N,X,Y,V}
mutable struct SDP{T,N,X,Y}
t::T
n::N
state::Function
Expand Down

0 comments on commit 2b14ef8

Please sign in to comment.