Skip to content

Commit

Permalink
fix bug with planner
Browse files Browse the repository at this point in the history
  • Loading branch information
Yirmandias committed Dec 14, 2023
1 parent 748ed45 commit 64825aa
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
5 changes: 4 additions & 1 deletion acting/core/src/model/sym_table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::ompas::manager::acting::acting_var::AsCst;
use crate::planning::conversion::flow_graph::graph::Dot;
use new_type::newtype;
use ompas_language::exec::resource::{MAX_Q, QUANTITY};
use ompas_language::exec::state::INSTANCE;
use ompas_language::exec::state::{INSTANCE, UNKNOWN};
use ompas_language::sym_table::*;
use sompas_language::kind::{ERR, NIL};
use sompas_structs::lnumber::LNumber;
Expand Down Expand Up @@ -180,6 +180,9 @@ impl SymTable {
),
);

//Add unk as symbol
st.new_constant_symbol(UNKNOWN, Domain::any());

st
}

Expand Down
3 changes: 3 additions & 0 deletions acting/core/src/planning/planner/encoding/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use aries_planning::chronicles::{
use aries_planning::parsing::pddl::TypedSymbol;
use env_param::EnvParam;
use function_name::named;
use ompas_language::exec::state::UNKNOWN;
use ompas_language::sym_table::*;
use sompas_structs::lruntimeerror;
use sompas_structs::lruntimeerror::LRuntimeError;
Expand Down Expand Up @@ -91,6 +92,8 @@ pub fn encode_ctx(
}
}

symbols.push(TypedSymbol::new(UNKNOWN, TYPE_OBJECT));

for sf in &domain.sf {
symbols.push(TypedSymbol::new(sf.get_label(), TYPE_STATE_FUNCTION));
}
Expand Down
28 changes: 14 additions & 14 deletions domains/gripper_door/base.scm
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@
))))

(def-command open (:params (?d door) (?r room) (?g gripper)))
(def-command-pddl-model open
(def-command-om-model open
(:params (?d door) (?r room) (?g gripper))
(:pre-conditions
(= (at-robby) ?r)
(= (carry ?g) empty)
(is_door_of ?d ?r))
(:effects
(durative 5 'opened ?d true)))
(:body
(do
(check (= (at-robby) ?r))
(check (= (carry ?g) empty))
(check (is_door_of ?d ?r))
(durative-effect 5 'opened ?d true))))

(def-command close (:params (?d door) (?r room) (?g gripper)))
(def-command-pddl-model close
(def-command-om-model close
(:params (?d door) (?r room) (?g gripper))
(:pre-conditions
(= (at-robby) ?r)
(= (carry ?g) empty)
(is_door_of ?d ?r))
(:effects
(durative 5 'opened ?d false)))
(:body
(do
(check (= (at-robby) ?r))
(check (= (carry ?g) empty))
(check (is_door_of ?d ?r))
(durative-effect 5 'opened ?d false))))
)
2 changes: 1 addition & 1 deletion stat/src/stat/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl From<&SystemStat> for SystemStatFormatter {
let header = ConfigProblemStat::header(&value.config.fields);
let header_len = header.len();
let mut empty_info = vec![Cell::start("ND".to_string()); header_len - 1];
empty_info.push(Cell::double("".to_string()));
empty_info.push(Cell::double("ND".to_string()));
for config_name in &config_order {
first_line.push(Cell {
info: config_name.format(),
Expand Down
3 changes: 2 additions & 1 deletion stat/statos.bash
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cargo run --bin statos -- -c config.yml > /home/jeremy/Bureau/result.txt
#cargo run --bin statos -- -c config.yml > /home/jeremy/Bureau/result.txt
cargo run --bin statos -- -c config_debug.yml > /home/jeremy/Bureau/result.txt

0 comments on commit 64825aa

Please sign in to comment.