lib/y_nelson.rb in y_nelson-2.1.0 vs lib/y_nelson.rb in y_nelson-2.3.0
- old
+ new
@@ -59,18 +59,32 @@
#
class << self
attr_reader :dimensions
# Including instance methods of YPetri::World:
- include YPetri::World::PetriNetRelated
- include YPetri::World::SimulationRelated
+ include YPetri::World::PetriNetAspect
+ include YPetri::World::SimulationAspect
# Allows summoning YNelson::DSL by 'include YNelson'.
#
def included receiver
receiver.extend YNelson::DSL
receiver.delegate :y_nelson_agent, to: "self.class"
end
+
+ # TODO: YNelson class, obviously, works. But there is something funny
+ # about how it works. It seems that all the important methods, such
+ # as Place(), Transition(), run!() don't go through the Agent (via
+ # receiver.extend YNelson::DSL), but instead go directly through
+ # include YPetri::World::PetriNetAspect and
+ # include YPetri::World::SimulationAspect. While it is appropriate
+ # that YNelson singleton class, since we have decided that it would
+ # be basically a kind of YPetri::World, should have attributes of
+ # YPetri::World, it is surprising that the method calls that are
+ # supposed to be intercepted by the agent and only then sent to the
+ # world, are handled by the world directly. This seems to be a problem
+ # and a topic for the future refactor.
+
end # class << self
# Parametrize the Place / Transition / Net classes.
param_class!( { Place: YNelson::Place,
Transition: YNelson::Transition,