Git Product home page Git Product logo

omtnplan's People

Contributors

fraleo avatar roveri-marco avatar

omtnplan's Issues

Possible problem with encoder

In encoder.py I had to check whether var_name in self.touched_variables for the

                    for var_name in utils.extractVariablesFC(self,pre):
                        # MR: If not touched, then skip it
                        if var_name in self.touched_variables:
                            tvariables.append(self.touched_variables[var_name])

in order to be able to convert the examples in pddl_examples/nl/nl_counters when metric constraints are added:

  (:goal (and   (<= (+ (value c0) 1) (value c1)) ))
  (:metric  maximize (* (value c0) (value c1))  )

metric expressions not properly handled

The construction of the Z3 terms for metric functions is not well structured. Indeed, the parse tree is used instead of the expression. Thus, if some term are moved from fluent to axiom (e.g. since they are constant), then errors are issued.

E.g. for the hvac benchmarks, this is ok

(:metric
  maximize (+ (- 48 (time)) (* (- (time) (temp r1)) (* (time) (temp r1))))
  )

while

(:metric
  maximize (+ (- 48 (time)) (* (- (time) (temp r1)) (* (time) (time_requested r1 k1))))
  )

is not since it rises an exception that time_requested_r1_k1 is not a fluent.

These domain get in assertion fault within task.py line 148.

(define (problem instance_2)
  (:domain fn-counters)
  (:objects
    c0 c1 - counter
  )

  (:init  (= (max_int) 4)   (= (value c0) 1)   (= (value c1) 1)   (= (rate_value c0) 1)    (= (rate_value c1) 1)  )

  (:goal (and   (<= (+ (value c0) 1) (value c1)) ))
  (:metric  maximize (* (value c0) (value c1))  )
)

The chain of (* (* (* is not properly handlet since it is assumed it is two.

 (define (domain fn-counters)
    (:requirements :strips  :adl :fluents)
    (:types counter)

    (:functions
        (value ?c - counter);; - int  ;; The value shown in counter ?c
        (rate_value ?c - counter);;
        (max_int);; -  int ;; The maximum integer we consider - a static value
    )

    ;; Increment the value in the given counter by a factor
    (:action increment
         :parameters (?c - counter)
         :precondition (and (<= (+ (value ?c) (* (value ?c) (+ 0 (* (rate_value ?c) (rate_value ?c))))) (max_int)))
         :effect (and (increase (value ?c) (* (value ?c) (+ 1 (* (rate_value ?c) (rate_value ?c))))))
    )
    ;; Decrement the value in the given counter by a factor
    (:action decrement
         :parameters (?c - counter)
         :precondition (and (>= (- (value ?c) (* (value ?c) (+ 0 (* (rate_value ?c) (rate_value ?c))))) 0))
         :effect (and (decrease (value ?c) (* (value ?c) (+ 1 (* (rate_value ?c) (rate_value ?c))))))
    )

    (:action increase_rate
         :parameters (?c - counter)
         :precondition (and (<= (+ (rate_value ?c) 1) 10))
         :effect (and (assign (rate_value ?c) (+ (rate_value ?c) (* (rate_value ?c) 0.5))))
    )

    (:action decrement_rate
         :parameters (?c - counter)
         :precondition (and (>= (rate_value ?c) 1))
         :effect (and (assign (rate_value ?c) (- (rate_value ?c) (* (rate_value ?c) 0.5))))
    )
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.