dollabs / planviz

Planning Network Visualization
Apache License 2.0
14 stars 4 forks source link

Bounds appear as #{nil} #58

Closed pmdoll closed 7 years ago

pmdoll commented 7 years ago

Where is this problem and what's the causing it?

Command to run planviz

planviz -i target/gen-files/isr-htn.htn.edn=target/gen-files/isr-htn.tpn.edn
tmarble commented 7 years ago

I was able to reproduce with:

  1. pamela -i ~/src/github/dollabs/pamela/test/pamela/regression/isr-htn.pamela -t "(isr-htn-demo.htn.main \"A\" \"B\" \"C\" \"D\")" -o isr-htn htn
  2. (in the CLJS REPL): (visualize {:verbose 2 :log-level :warn :input ["isr-htn.htn.json=isr-htn.tpn.json"]})

The temporal constraints appear as #{nil}.

For verification I tested the plan-schema merge operation to see if the source of the problem.. and it is:

  1. plan-schema -i isr-htn.htn.json -i isr-htn.tpn.json -o isr-htn.merge.edn merge

The first :temporal-constraint from isr-htn.merge.edn is:

  {:plan/plid :isr-htn.tpn,
   :edge/id :tc-204,
   :edge/type :temporal-constraint,
   :edge/from :isr-htn.tpn:node-206,
   :edge/to :isr-htn.tpn:node-199,
   :edge/value #{nil}},

Thus this is now a plan-schema bug.

tmarble commented 7 years ago

Further investigation determines that the error is introduced in the parse-tpn function portion of the merge. From the original JSON:

 "tc-204":
 {"tpn-type":"temporal-constraint",
  "uid":"tc-204",
  "value":[15, 25],
  "end-node":"node-199"},

Then after running plan-schema -i isr-htn.tpn.json -o isr-htn.tpn.edn tpn the EDN is:

 :tc-204
 {:tpn-type :temporal-constraint,
  :uid :tc-204,
  :value #{nil},
  :end-node :node-199},
pmdoll commented 7 years ago

This issue was caused by a plan-schema bug. Fixed in plan-schema revision daf7628ee92f00c836a44bc60ac939303df78eda