1010abstract type RiskMeasure end
1111
1212# Define an object to
13- type Expectation <: RiskMeasure
13+ mutable struct Expectation <: RiskMeasure
1414 function Expectation ()
1515 return new ()
1616 end
1717end
1818
19- type AVaR <: RiskMeasure
19+ mutable struct AVaR <: RiskMeasure
2020 # If the random variable is a cost and beta = 0.05,
2121 # it returns the average of the five worst costs solving the problem
2222 # minimize alpha + 1/beta * E[max(X - alpha; 0)]
@@ -28,13 +28,13 @@ type AVaR <: RiskMeasure
2828 end
2929end
3030
31- type WorstCase <: RiskMeasure
31+ mutable struct WorstCase <: RiskMeasure
3232 function WorstCase ()
3333 return new ()
3434 end
3535end
3636
37- type ConvexCombi <: RiskMeasure
37+ mutable struct ConvexCombi <: RiskMeasure
3838 # Define a convex combination between Expectation and AVaR_{beta}
3939 # with form lambda*E + (1-lambda)*AVaR
4040 # lambda = 1 ==> Expectation
@@ -46,7 +46,7 @@ type ConvexCombi <: RiskMeasure
4646 end
4747end
4848
49- type PolyhedralRisk <: RiskMeasure
49+ mutable struct PolyhedralRisk <: RiskMeasure
5050 # Define a convex polyhedral set P of probability distributions
5151 # by its extreme points p1, ..., pn
5252 # In the case of costs X, the problem solved is
6161abstract type SPModel end
6262
6363
64- type PolyhedralFunction
64+ mutable struct PolyhedralFunction
6565 # function defined by max_k betas[k] + lambdas[k,:]*x
6666 betas:: Vector{Float64}
6767 lambdas:: Array{Float64,2} # lambdas[k,:] is the subgradient
@@ -81,7 +81,7 @@ function fetchnewcuts!(V::PolyhedralFunction)
8181 return β, λ
8282end
8383
84- type LinearSPModel <: SPModel
84+ mutable struct LinearSPModel <: SPModel
8585 # problem dimension
8686 stageNumber:: Int64 # number of information step + 1
8787 dimControls:: Int64
@@ -139,7 +139,7 @@ type LinearSPModel <: SPModel
139139 Vf = PolyhedralFunction (zeros (1 ), zeros (1 , dimStates), 1 , UInt64[], 0 )
140140 end
141141
142- isbu = isa (control_cat, Vector{Symbol})? control_cat: [:Cont for i in 1 : dimControls]
142+ isbu = isa (control_cat, Vector{Symbol}) ? control_cat : [:Cont for i in 1 : dimControls]
143143 is_smip = (:Int in isbu)|| (:Bin in isbu)
144144
145145 if (x_bounds == nothing )
@@ -195,7 +195,7 @@ function max_bounds(bounds::Array)
195195 [(m_bounds[i,1 ], m_bounds[i,2 ]) for i in 1 : size (bounds)[1 ]]
196196end
197197
198- type StochDynProgModel <: SPModel
198+ mutable struct StochDynProgModel <: SPModel
199199 # problem dimension
200200 stageNumber:: Int64
201201 dimControls:: Int64
@@ -239,8 +239,8 @@ type StochDynProgModel <: SPModel
239239 finalCostFunction, dynamic, constraints, aleas, search_space_builder = Nullable {Function} ())
240240 dimState = length (x0)
241241 dimControls = size (u_bounds)[1 ]
242- u_bounds1 = ndims (u_bounds) == 1 ? u_bounds : max_bounds (u_bounds)
243- x_bounds1 = ndims (x_bounds) == 1 ? x_bounds : max_bounds (x_bounds)
242+ u_bounds1 = ndims (u_bounds) == 1 ? u_bounds : max_bounds (u_bounds)
243+ x_bounds1 = ndims (x_bounds) == 1 ? x_bounds : max_bounds (x_bounds)
244244
245245
246246 return new (TF, dimControls, dimState, length (aleas[1 ]. support[:, 1 ]),
@@ -252,7 +252,7 @@ type StochDynProgModel <: SPModel
252252end
253253
254254
255- type SDPparameters
255+ mutable struct SDPparameters
256256 stateSteps
257257 controlSteps
258258 totalStateSpaceSize
@@ -295,7 +295,7 @@ abstract type AbstractSDDPStats end
295295
296296# Define an object to store evolution of solution
297297# along iterations:
298- type SDDPStat <: AbstractSDDPStats
298+ mutable struct SDDPStat <: AbstractSDDPStats
299299 # Number of iterations:
300300 niterations:: Int
301301 # evolution of lower bound:
361361
362362
363363abstract type AbstractNLDSSolution end
364- type NLDSSolution <: AbstractNLDSSolution
364+ mutable struct NLDSSolution <: AbstractNLDSSolution
365365 # solver status:
366366 status:: Bool
367367 # cost:
@@ -378,7 +378,7 @@ type NLDSSolution <: AbstractNLDSSolution
378378 πc:: Vector{Float64}
379379end
380380
381- type DHNLDSSolution <: AbstractNLDSSolution
381+ mutable struct DHNLDSSolution <: AbstractNLDSSolution
382382 # solver status:
383383 status:: Bool
384384 # cost:
0 commit comments