@@ -263,20 +263,14 @@ def exec_sed_task(task, variables, preprocessed_task=None, log=None, config=None
263
263
264
264
# simulate
265
265
if isinstance (sim , UniformTimeCourseSimulation ):
266
- number_of_points = (sim .output_end_time - sim .initial_time ) / \
267
- (sim .output_end_time - sim .output_start_time ) * sim .number_of_steps + 1
268
- if abs (number_of_points % 1 ) > 1e-8 :
269
- msg = (
270
- 'The number of simulation points `{}` must be an integer:'
271
- '\n Initial time: {}'
272
- '\n Output start time: {}'
273
- '\n Output end time: {}'
274
- '\n Number of points: {}'
275
- ).format (number_of_points , sim .initial_time , sim .output_start_time , sim .output_start_time , sim .number_of_points )
276
- raise NotImplementedError (msg )
277
-
278
- number_of_points = round (number_of_points )
279
- results = numpy .array (road_runner .simulate (sim .initial_time , sim .output_end_time , number_of_points ).tolist ()).transpose ()
266
+ if sim .initial_time < sim .output_start_time :
267
+ number_of_presim_points = (sim .output_end_time - sim .initial_time ) / \
268
+ (sim .output_end_time - sim .output_start_time ) * sim .number_of_steps + 1
269
+
270
+ number_of_presim_points = round (number_of_presim_points ) - sim .number_of_steps
271
+ road_runner .simulate (sim .initial_time , sim .output_start_time , number_of_presim_points )
272
+
273
+ results = numpy .array (road_runner .simulate (sim .output_start_time , sim .output_end_time , sim .number_of_steps + 1 ).tolist ()).transpose ()
280
274
else :
281
275
road_runner .steadyState ()
282
276
results = road_runner .getSteadyStateValues ()
0 commit comments