@@ -64,6 +64,7 @@ def __init__(
64
64
self ,
65
65
max_time : int = 30 ,
66
66
visualize : bool = False ,
67
+ value_on_unplayable : float = np .NaN ,
67
68
batch_size : int = None ,
68
69
parallelize : bool = False ,
69
70
num_workers : int = None ,
@@ -91,8 +92,9 @@ def __init__(
91
92
evaluation_budget = evaluation_budget ,
92
93
)
93
94
self .force_isolation = force_isolation
94
- self .max_time = max_time
95
+ self .max_time = int ( max_time )
95
96
self .visualize = visualize
97
+ self .value_on_unplayable = value_on_unplayable
96
98
_ = get_inner_function (
97
99
isolated_function_name = "super_mario_bros__isolated" ,
98
100
class_name = "SMBIsolatedLogic" ,
@@ -101,6 +103,7 @@ def __init__(
101
103
alphabet = smb_info .alphabet ,
102
104
max_time = self .max_time ,
103
105
visualize = self .visualize ,
106
+ value_on_unplayable = self .value_on_unplayable ,
104
107
)
105
108
106
109
def _black_box (self , x : np .ndarray , context = None ) -> np .ndarray :
@@ -114,6 +117,7 @@ def _black_box(self, x: np.ndarray, context=None) -> np.ndarray:
114
117
alphabet = smb_info .alphabet ,
115
118
max_time = self .max_time ,
116
119
visualize = self .visualize ,
120
+ value_on_unplayable = self .value_on_unplayable ,
117
121
)
118
122
return inner_function (x , context )
119
123
@@ -142,6 +146,7 @@ def create(
142
146
self ,
143
147
max_time : int = 30 ,
144
148
visualize : bool = False ,
149
+ value_on_unplayable : float = np .NaN ,
145
150
seed : int = None ,
146
151
batch_size : int = None ,
147
152
parallelize : bool = False ,
@@ -182,6 +187,7 @@ def create(
182
187
f = SuperMarioBrosBlackBox (
183
188
max_time = max_time ,
184
189
visualize = visualize ,
190
+ value_on_unplayable = value_on_unplayable ,
185
191
batch_size = batch_size ,
186
192
parallelize = parallelize ,
187
193
num_workers = num_workers ,
0 commit comments