-
Notifications
You must be signed in to change notification settings - Fork 0
/
Parameters.go
57 lines (50 loc) · 1.29 KB
/
Parameters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (c) 2019 Australian Rivers Institute.
package parameters
import (
"github.com/LindsayBradford/crem/internal/pkg/parameters"
. "github.com/LindsayBradford/crem/internal/pkg/parameters/specification"
)
type Parameters struct {
parameters.Parameters
}
func (p *Parameters) Initialise() *Parameters {
p.Parameters.
Initialise("Multi-Objective Dumb Model Parameter Validation").
Enforcing(ParameterSpecifications())
return p
}
const (
InitialObjectiveOneValue = "InitialObjectiveOneValue"
InitialObjectiveTwoValue = "InitialObjectiveTwoValue"
InitialObjectiveThreeValue = "InitialObjectiveThreeValue"
NumberOfPlanningUnits = "NumberOfPlanningUnits"
)
func ParameterSpecifications() *Specifications {
specs := NewSpecifications()
specs.Add(
Specification{
Key: InitialObjectiveOneValue,
Validator: IsDecimal,
DefaultValue: float64(1000),
},
).Add(
Specification{
Key: InitialObjectiveTwoValue,
Validator: IsDecimal,
DefaultValue: float64(2000),
},
).Add(
Specification{
Key: InitialObjectiveThreeValue,
Validator: IsDecimal,
DefaultValue: float64(3000),
},
).Add(
Specification{
Key: NumberOfPlanningUnits,
Validator: IsNonNegativeInteger,
DefaultValue: int64(100),
},
)
return specs
}