Skip to content

Commit 7665569

Browse files
committed
[UPD] Fix mix-identation problem
1 parent 4d5b34d commit 7665569

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

src/SDDPoptimize.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ Parameters:
162162
163163
Return:
164164
- upb (Float64)
165-
estimation of upper bound
165+
estimation of upper bound
166166
167167
- costs (Vector{Float64})
168-
Costs along different trajectories
168+
Costs along different trajectories
169169
170170
"""
171171
function estimate_upper_bound(model::SPModel, param::SDDPparameters, V::Vector{PolyhedralFunction}, problem::Vector{JuMP.Model}, n_simulation=1000::Int)

src/SDPoptimize.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ function sdp_solve_DH(model::StochDynProgModel,
258258
println("Starting stochastic dynamic programming decision hazard computation")
259259
end
260260

261-
# Loop over time:
261+
# Loop over time:
262262
for t = (TF-1):-1:1
263263
Vitp = value_function_interpolation(model, V, t+1)
264264

@@ -559,9 +559,9 @@ Returns :
559559
"""
560560
function get_control(model::SPModel,param::SDPparameters,V::Array{Float64}, t::Int64, x::Array)
561561

562-
if(param.infoStructure != "DH")
563-
error("Infostructure must be decision-hazard.")
564-
end
562+
if(param.infoStructure != "DH")
563+
error("Infostructure must be decision-hazard.")
564+
end
565565
SDPmodel = build_sdpmodel_from_spmodel(model)
566566

567567
product_controls = product([SDPmodel.ulim[i][1]:param.controlSteps[i]:SDPmodel.ulim[i][2] for i in 1:SDPmodel.dimControls]...)
@@ -644,9 +644,9 @@ Returns :
644644
"""
645645
function get_control(model::SPModel,param::SDPparameters,V::Array{Float64}, t::Int64, x::Array, w::Array)
646646

647-
if(param.infoStructure != "HD")
648-
error("Infostructure must be hazard-decision.")
649-
end
647+
if(param.infoStructure != "HD")
648+
error("Infostructure must be hazard-decision.")
649+
end
650650

651651
SDPmodel = build_sdpmodel_from_spmodel(model)
652652

src/noises.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ type NoiseLaw
1717
support::Array{Float64,2}
1818
# Probabilities of points:
1919
proba::Vector{Float64}
20-
function NoiseLaw(supportSize, support, proba)
21-
supportSize = convert(Int64,supportSize)
22-
if ndims(support)==1
23-
support = reshape(support,1,length(support))
24-
end
25-
26-
if ndims(proba) == 2
27-
proba = vec(proba)
28-
elseif ndims(proba) >= 2
29-
proba = squeeze(proba,1)
30-
end
31-
32-
return new(supportSize,support,proba)
33-
end
20+
function NoiseLaw(supportSize, support, proba)
21+
supportSize = convert(Int64,supportSize)
22+
if ndims(support)==1
23+
support = reshape(support,1,length(support))
24+
end
25+
26+
if ndims(proba) == 2
27+
proba = vec(proba)
28+
elseif ndims(proba) >= 2
29+
proba = squeeze(proba,1)
30+
end
31+
32+
return new(supportSize,support,proba)
33+
end
3434

3535
end
3636

0 commit comments

Comments
 (0)