Closed dcerys closed 7 years ago
All of the metadata in a primitive method declaration is ignored. E.g., :bounds
, :display-name
Here's a slightly extended example that shows the use of :display-name
in do-a
, which is currently ignored:
(defpclass plant []
:meta {:doc "The Plant API"}
:methods [(defpmethod do-a {:bounds [2 4]
:display-name "Due Eh"} [])
(defpmethod do-b {:bounds [3 6]} [])
(defpmethod do-c {:bounds [4 8]} [])
(defpmethod do-d [])
(defpmethod do-e {:bounds [5 10]} [])])
(defpclass infeasible-sequence [plnt]
:meta {:doc "An example of infeasible sequence of activties"}
:methods [(defpmethod start
{:doc "Simple TPN with constraints"
:bounds [9 30]
:display-name "START"}
[]
(sequence ;;:bounds [10 30]
(plnt.do-a)
(plnt.do-b)
(plnt.do-c)
(plnt.do-d)
(plnt.do-e)))])
;; NOTE this pclass must be defined to make the plant instanciation
;; explicit. Root-task: (infeasible-sequence.demo.run.start)
(defpclass infeasible-sequence-demo []
:fields {:p1 (plant :id "p1" :plant-part "t1" :interface "RMQ")
:run (infeasible-sequence p1)})
:bounds
is currently supported, but the other metadata still needs to be added.
In the following example, the
:bounds
declared for the primitive methods (e.g.,do-a
) aren't included in the generated TPN (generated using thehtn
action)