roveri-marco / omtnplan Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fraleo/omtplan
A python framework for Optimal Planning Modulo Theories
License: GNU General Public License v3.0
This project forked from fraleo/omtplan
A python framework for Optimal Planning Modulo Theories
License: GNU General Public License v3.0
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)) )
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.
(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))))
)
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.