-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPlottedSimTest.cs
More file actions
53 lines (44 loc) · 1.75 KB
/
PlottedSimTest.cs
File metadata and controls
53 lines (44 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Godot;
using PrimerTools.AnimationSequence;
[Tool]
public partial class PlottedSimTest : AnimationSequence
{
protected override void Define()
{
var currentTime = System.Environment.TickCount;
// var stopwatch = new System.Diagnostics.Stopwatch();
// stopwatch.Start();
// Run the simulation
var sim = new EvoGameTheorySim();
AddChild(sim);
// sim.NumDays = 50; // 43ish seconds
sim.NumDays = 5; // 15 ish seconds
// sim.NumDays = 100; // Crash
sim.InitialBlobCount = 40;
sim.NumTrees = 5;
sim.RunSim();
// GD.Print("Sim time: " + stopwatch.ElapsedMilliseconds);
// stopwatch.Restart();
#region Animate the results
var simAnimator = new EvoGameTheorySimAnimator();
AddChild(simAnimator);
simAnimator.Owner = GetTree().EditedSceneRoot;
simAnimator.Sim = sim;
// simAnimator.IncludeTernaryPlot = true;
simAnimator.NonAnimatedSetup();
// Spawn and move blobs according to the results
// GD.Print("Non-animated time: " + stopwatch.ElapsedMilliseconds);
// stopwatch.Restart();
RegisterAnimation(simAnimator.AnimateAllDays());
// GD.Print("Total animation generation time: " + stopwatch.ElapsedMilliseconds);
// stopwatch.Restart();
#endregion
// GD.Print("Total time: " + (System.Environment.TickCount - currentTime) + " ms");
#region Plot the results
// simAnimator.SetUpTernaryPlot();
// RegisterAnimation(simAnimator.AnimateTernaryPlotToDay());
// GD.Print("Plot time: " + stopwatch.ElapsedMilliseconds);
// stopwatch.Restart();
#endregion
}
}