Sha256: cb7fe72889db27be59e7195bb876b624be8aba9fe4edc1185ac273fdcfc16b30

Contents?: true

Size: 930 Bytes

Versions: 1

Compression:

Stored size: 930 Bytes

Contents

# As the name suggests, represents the world. Holds places, transitions, nets
# and other assets needed to set up and simulate Petri nets (settings, clamps,
# initial markings etc.). Provides basic methods to do what is necessary.
# More ergonomic and DSL-like methods are up to the YPetri::Agent.
# 
class YPetri::World
  include NameMagic

  require_relative 'world/dependency'
  require_relative 'world/petri_net_related'
  require_relative 'world/simulation_related'

  include self::PetriNetRelated
  include self::SimulationRelated

  def initialize
    # Parametrize the Place / Transition / Net classes.
    param_class!( { Place: YPetri::Place,
                    Transition: YPetri::Transition,
                    Net: YPetri::Net },
                  with: { world: self } )
    # Make them their own namespaces.
    [ Place(), Transition(), Net() ].each &:namespace!
    # And proceeed as usual.
    super
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
y_petri-2.1.3 lib/y_petri/world.rb