... | ... | @@ -6,13 +6,19 @@ class Simulation { |
|
|
+ step(real dt)
|
|
|
-- internal --
|
|
|
# subStep1(real dt)
|
|
|
# subSTepN(real dt)
|
|
|
# subStepN(real dt)
|
|
|
}
|
|
|
class SimulationTracker {
|
|
|
+{abstract} beforeStep()
|
|
|
+{abstract} afterStep()
|
|
|
+{abstract} planetsChanged()
|
|
|
+{abstract} gasAccreted(momentum)
|
|
|
|
|
|
+{static} declare(TrackerCreator)
|
|
|
+{static} create(string, map<string,string> cfg)
|
|
|
-- protected --
|
|
|
map<string,string> config;
|
|
|
{static}map<string,TrackerCreator> creator;
|
|
|
}
|
|
|
class CompoundTracker {
|
|
|
+add(SimulationTracker)
|
... | ... | @@ -22,21 +28,32 @@ class CompoundTracker { |
|
|
+{abstract} gasAccreted(momentum)
|
|
|
}
|
|
|
class ConcreteTrackerA {
|
|
|
+{abstract} beforeStep()
|
|
|
+{abstract} afterStep()
|
|
|
+{abstract} planetsChanged()
|
|
|
+{abstract} gasAccreted(momentum)
|
|
|
+ beforeStep()
|
|
|
+ afterStep()
|
|
|
+ planetsChanged()
|
|
|
+ gasAccreted(momentum)
|
|
|
}
|
|
|
class ConcreteTrackerB {
|
|
|
+{abstract} beforeStep()
|
|
|
+{abstract} afterStep()
|
|
|
+{abstract} planetsChanged()
|
|
|
+{abstract} gasAccreted(momentum)
|
|
|
+ beforeStep()
|
|
|
+ afterStep()
|
|
|
+ planetsChanged()
|
|
|
+ gasAccreted(momentum)
|
|
|
}
|
|
|
class TrackerCreator {
|
|
|
{abstract} SimulationTracker create(Simulation const&, map<string,string> cfg);
|
|
|
}
|
|
|
class ConcreteTrackerCreatorA {
|
|
|
SimulationTracker create(Simulation const&, map<string,string> cfg);
|
|
|
}
|
|
|
class ConcreteTrackerCreatorB {
|
|
|
SimulationTracker create(Simulation const&, map<string,string> cfg);
|
|
|
}
|
|
|
Simulation*--CompoundTracker
|
|
|
SimulationTracker--Simulation
|
|
|
SimulationTracker<|--CompoundTracker
|
|
|
SimulationTracker<|--ConcreteTrackerA
|
|
|
SimulationTracker<|--ConcreteTrackerB
|
|
|
TrackerCreator<|--ConcreteTrackerCreatorA
|
|
|
TrackerCreator<|--ConcreteTrackerCreatorB
|
|
|
CompoundTracker*-->"many" SimulationTracker
|
|
|
``` |