explore function
void
explore(
- FutureOr<
void> body(- Simulation sim
- int seeds = 100,
- int firstSeed = 0,
- FaultPolicy? faults,
- ActorSystemConfig config()?,
- int maxSteps = 100000,
- Duration maxTime = const Duration(hours: 1),
Runs body under seeds different seeds, starting at firstSeed, and
stops at the first one it fails under.
The failure is rethrown as a SimulationFailure that names the seed and shows the last scheduling steps. Pass that seed to simulate to get the same run again.
Implementation
void explore(
FutureOr<void> Function(Simulation sim) body, {
int seeds = 100,
int firstSeed = 0,
FaultPolicy? faults,
ActorSystemConfig Function()? config,
int maxSteps = 100000,
Duration maxTime = const Duration(hours: 1),
}) {
for (var seed = firstSeed; seed < firstSeed + seeds; seed++) {
final sim = Simulation._(seed, faults, maxSteps, maxTime);
try {
sim._run(body, config?.call());
} catch (e, s) {
throw SimulationFailure(seed, e, s, sim._trace);
}
}
}