|
|
@@ -25,7 +25,7 @@ def runthemodel(seed: int, dimensions: tuple[int, int], sheep: int, wolves: int,
|
|
|
setup = ("from WolfSheep import WolfSheepEcosystem\n"
|
|
|
"from benchmark_wolfsheep import runthemodel")
|
|
|
|
|
|
-n_run = 100
|
|
|
+n_run = 10
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
# import cProfile
|
|
|
@@ -49,8 +49,8 @@ if __name__ == '__main__':
|
|
|
median_time = sorted(a)[n_run // 2 + n_run % 2]
|
|
|
print(f"PyPDEVS WolfSheep-small Median Time for {n_run} runs (ms):", median_time * 1e3)
|
|
|
|
|
|
- print("Running Wolf Sheep Grass in a 100x100 space, with a thousand sheep and five hundred wolves")
|
|
|
- tt = timeit.Timer(f'runthemodel(42, (100, 100), 1000, 500, 0.4, 0.2, 10)', setup=setup)
|
|
|
- a = tt.repeat(n_run, 1)
|
|
|
- median_time = sorted(a)[n_run // 2 + n_run % 2]
|
|
|
- print(f"PyPDEVS WolfSheep-large Median Time for {n_run} runs (ms):", median_time * 1e3)
|
|
|
+ # print("Running Wolf Sheep Grass in a 100x100 space, with a thousand sheep and five hundred wolves")
|
|
|
+ # tt = timeit.Timer(f'runthemodel(42, (100, 100), 1000, 500, 0.4, 0.2, 10)', setup=setup)
|
|
|
+ # a = tt.repeat(n_run, 1)
|
|
|
+ # median_time = sorted(a)[n_run // 2 + n_run % 2]
|
|
|
+ # print(f"PyPDEVS WolfSheep-large Median Time for {n_run} runs (ms):", median_time * 1e3)
|