@@ -92,10 +92,11 @@ def populate_num_shapes_unit(data):
92
92
area = data ['width' ] * data ['height' ]
93
93
data ['num_shapes_unit' ] = data ['num_shapes_abs' ] / area
94
94
95
+
95
96
inputs = [
96
- {"name" : "width" , "type" : float , "distribution" : " uniform" },
97
- {"name" : "height" , "type" : float , "distribution" : " uniform" },
98
- {"name" : "intensity" , "type" : float , "distribution" : " uniform" }
97
+ {"name" : "width" , "type" : float , "distribution" : scipy . stats . uniform ( 0 , 10 ) },
98
+ {"name" : "height" , "type" : float , "distribution" : scipy . stats . uniform ( 0 , 10 ) },
99
+ {"name" : "intensity" , "type" : float , "distribution" : scipy . stats . uniform ( 0 , 10 ) }
99
100
]
100
101
101
102
outputs = [
@@ -104,23 +105,13 @@ def populate_num_shapes_unit(data):
104
105
]
105
106
106
107
metas = [
107
- {"name" : "num_lines_unit" , "type" : float , "populate" : " populate_num_lines_unit" },
108
- {"name" : "num_shapes_unit" , "type" : float , "populate" : " populate_num_shapes_unit" },
109
- {"name" : "width_plus_height" , "type" : float , "populate" : " populate_width_height" }
108
+ {"name" : "num_lines_unit" , "type" : float , "populate" : populate_num_lines_unit },
109
+ {"name" : "num_shapes_unit" , "type" : float , "populate" : populate_num_shapes_unit },
110
+ {"name" : "width_plus_height" , "type" : float , "populate" : populate_width_height }
110
111
]
111
112
112
113
constraints = ["width > 0" , "height > 0" , "intensity > 0" ]
113
114
114
- populates = {
115
- "populate_width_height" : populate_width_height ,
116
- "populate_num_lines_unit" : populate_num_lines_unit ,
117
- "populate_num_shapes_unit" : populate_num_shapes_unit
118
- }
119
-
120
- distributions = {
121
- "uniform" : scipy .stats .uniform (0 , 10 )
122
- }
123
-
124
115
effects = {
125
116
"PoissonWidthHeight" : PoissonWidthHeight (),
126
117
"Positive" : Positive (),
@@ -136,9 +127,9 @@ def populate_num_shapes_unit(data):
136
127
}
137
128
138
129
# Create input structure required to create a modelling scenario
139
- modelling_inputs = [Input (i ['name' ], i ['type' ], distributions [ i ['distribution' ] ]) for i in inputs ] + \
130
+ modelling_inputs = [Input (i ['name' ], i ['type' ], i ['distribution' ]) for i in inputs ] + \
140
131
[Output (i ['name' ], i ['type' ]) for i in outputs ] + \
141
- [Meta (i ['name' ], i ['type' ], populates [i ['populate' ]]) for i in metas ] if metas else list ()
132
+ [Meta (i ['name' ], i ['type' ], [i ['populate' ]]) for i in metas ] if metas else list ()
142
133
143
134
# Create modelling scenario to access z3 variable mirrors
144
135
modelling_scenario = Scenario (modelling_inputs , None )
0 commit comments