lib/y_petri.rb in y_petri-2.3.10 vs lib/y_petri.rb in y_petri-2.3.11
- old
+ new
@@ -33,36 +33,40 @@
require_relative 'y_petri/simulation'
require_relative 'y_petri/core'
require_relative 'y_petri/agent'
require_relative 'y_petri/dsl'
-# YPetri is a domain model and a domain-specific language (DSL) for modelling
-# dynamical systems. (Industrial modellers use the term DSML – domain specific
-# modelling language.) YPetri caters solely to the two main concerns of
-# modelling: model specification and simulation, excelling in the first one.
+# YPetri is a domain-specific language (DSL) for modelling dynamical systems. It
+# caters solely to the two main concerns of modelling: model specification and
+# simulation.
#
-# YPetri model specification is based on a Petri net paradigm. A Petri net (PN)
-# is a bipartite graph with two kinds of nodes: places and transitions. Places
-# are visualised as circles, transitions as rectangles. During PN execution
-# (simulation), transitions act upon places and change their marking by adding
-# / removing tokens as dictated by the prescription of their operation. For
-# classical PNs, transition action is a discrete stoichiometric addition /
-# subtraction of tokens to / from the connected places. However, many extended
-# PN types have been defined, where the transition action is determined by a
-# mathematical function attached to the transition. Such transitions are called
-# functional, and almost all YPetri transitions are of this type. Borrowing more
-# from the terminology of functions, YPetri defines keywords domain an codomain
-# for transitions in a way similar to the domain and codomain of functions.
+# Model specification in YPetri is based on a Petri net. Classical Petri net
+# (PN), originally described by Carl Adam Petri in 1962, is a bipartite graph
+# with two kinds of nodes: places (circles) and transitions (rectangles),
+# connected by arcs (lines). Places act as variables – each place holds exactly
+# one value ("marking"), a discrete number imagined as consisting of individual
+# units ("tokens"). The action of transitions ("firing") is also discrete. Each
+# time a transition fires, a fixed number of tokens is added/subtracted to the
+# connected places. It turns out that classical PNs are very useful in describing
+# things like industrial systems, production lines, and also basic chemical
+# systems with a number of molecules is connected by stoichiometric reactions.
#
-# Many extended PN types have been defined. YPetri implements a universal PN
-# abstraction designed to subsume and integrate the dichotomies of the common
-# extended PN types. YPetri unifies discrete and stochastic modelling of timed
-# transitions at the level of model specification in line with the present day
-# unifying Petri net frameworks. YPetri also integrates other dichotomies: timed
-# / timeless and stoichiometric / nonstoichiometric. The idea is to save the
-# Ruby-based modeller the work of researching different PN types and provide a
-# single abstraction and the DSL to rule them all.
-#
+# YPetri allows specification of not just classical PNs, but also of many
+# extended Petri net (XPN) types, which have been described since Petri's work.
+# This is achieved by making YPetri transitions functional (mathematical
+# functions in lambda notation can be attached to them), and allowing the
+# possibility of transitions being defined as either timed and timeless, and as
+# eithier nonstoichiometric and explicitly stoichiometric. Together, this makes 4
+# types of functional transitions available in YPetri, which can be used to
+# capture almost any type of XPN. In this way, YPetri can serve as a common
+# platform for data exchange and cooperation between different XPN formalisms,
+# without sacrificing the special qualities of XPNs described thus far.
+#
+# The basic simulation method is simple PN execution. In its course, transitions
+# fire, and thereby change the places' marking by adding/removing tokens as
+# dictated by their operating prescription. Other simulation methods become
+# available for more specific net types, such as timed nets.
+#
module YPetri
class << self
def included( receiver )
receiver.extend YPetri::DSL
receiver.delegate :y_petri_agent, to: "self.class"