Skip to content

Commit 162c361

Browse files
authored
Merge pull request #217 from plaans/feat/plan-optimizer
feat(ape): plan optimization MVP
2 parents a84cf18 + 279424f commit 162c361

126 files changed

Lines changed: 3606 additions & 1109 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/aries.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
run: ./ci/sat.py debug
5151
- name: Scheduler testing
5252
run: ./ci/scheduling.py
53+
- name: APE validator
54+
run: ./ci/ape-val.sh
5355
- name: GG solving
5456
run: ./ci/gg.py
5557
- name: PDDL Solving (PDDL & HDDL)

Cargo.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ tokio = { default-features = false, version = "1.49.0", features = [
6060
"macros",
6161
] }
6262
tokio-stream = { default-features = false, version = "0.1" }
63-
tracing = { version = "0.1", features = ["release_max_level_debug"] }
63+
tracing = { version = "0.1", features = ["release_max_level_info"] }
6464
tracing-subscriber = "0.3"
6565
transitive = "1.2.0"
6666
vec_map = "0.8"

aries_fzn/src/aries/constraint/abs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use aries::model::Label;
22
use aries::model::Model;
33
use aries::model::lang::IVar;
4-
use aries::model::lang::linear::NFLinearSumItem;
4+
use aries::model::lang::linear::ScaledVar;
55

66
use crate::aries::Post;
77
use crate::aries::constraint::LinEq;
@@ -40,11 +40,11 @@ impl<Lbl: Label> Post<Lbl> for Abs {
4040
let plus_a = self.a;
4141

4242
let sum = vec![
43-
NFLinearSumItem {
43+
ScaledVar {
4444
var: plus_a.into(),
4545
factor: 1,
4646
},
47-
NFLinearSumItem {
47+
ScaledVar {
4848
var: minus_a.into(),
4949
factor: 1,
5050
},

aries_fzn/src/aries/constraint/lin_eq.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use aries::core::IntCst;
22
use aries::model::Label;
33
use aries::model::Model;
4-
use aries::model::lang::linear::NFLinearSumItem;
4+
use aries::model::lang::linear::ScaledVar;
55

66
use crate::aries::Post;
77
use crate::aries::constraint::LinGe;
@@ -13,16 +13,16 @@ use crate::aries::constraint::LinLe;
1313
/// where `v[i]` are variables, `b` and `c[i]` constants.
1414
#[derive(Debug)]
1515
pub struct LinEq {
16-
sum: Vec<NFLinearSumItem>,
16+
sum: Vec<ScaledVar>,
1717
b: IntCst,
1818
}
1919

2020
impl LinEq {
21-
pub fn new(sum: Vec<NFLinearSumItem>, b: IntCst) -> Self {
21+
pub fn new(sum: Vec<ScaledVar>, b: IntCst) -> Self {
2222
Self { sum, b }
2323
}
2424

25-
pub fn sum(&self) -> &Vec<NFLinearSumItem> {
25+
pub fn sum(&self) -> &Vec<ScaledVar> {
2626
&self.sum
2727
}
2828

aries_fzn/src/aries/constraint/lin_eq_half.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use aries::core::IntCst;
22
use aries::model::Label;
33
use aries::model::Model;
44
use aries::model::lang::BVar;
5-
use aries::model::lang::linear::NFLinearSumItem;
5+
use aries::model::lang::linear::ScaledVar;
66

77
use crate::aries::Post;
88
use crate::aries::constraint::LinGeHalf;
@@ -16,17 +16,17 @@ use crate::aries::constraint::LinLeHalf;
1616
/// `b` and `c[i]` constants.
1717
#[derive(Debug)]
1818
pub struct LinEqHalf {
19-
sum: Vec<NFLinearSumItem>,
19+
sum: Vec<ScaledVar>,
2020
b: IntCst,
2121
r: BVar,
2222
}
2323

2424
impl LinEqHalf {
25-
pub fn new(sum: Vec<NFLinearSumItem>, b: IntCst, r: BVar) -> Self {
25+
pub fn new(sum: Vec<ScaledVar>, b: IntCst, r: BVar) -> Self {
2626
Self { sum, b, r }
2727
}
2828

29-
pub fn sum(&self) -> &Vec<NFLinearSumItem> {
29+
pub fn sum(&self) -> &Vec<ScaledVar> {
3030
&self.sum
3131
}
3232

aries_fzn/src/aries/constraint/lin_eq_reif.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use aries::core::IntCst;
22
use aries::model::Label;
33
use aries::model::Model;
44
use aries::model::lang::BVar;
5-
use aries::model::lang::linear::NFLinearSumItem;
5+
use aries::model::lang::linear::ScaledVar;
66

77
use crate::aries::Post;
88
use crate::aries::constraint::AndReif;
@@ -17,17 +17,17 @@ use crate::aries::constraint::LinLeReif;
1717
/// `b` and `c[i]` constants.
1818
#[derive(Debug)]
1919
pub struct LinEqReif {
20-
sum: Vec<NFLinearSumItem>,
20+
sum: Vec<ScaledVar>,
2121
b: IntCst,
2222
r: BVar,
2323
}
2424

2525
impl LinEqReif {
26-
pub fn new(sum: Vec<NFLinearSumItem>, b: IntCst, r: BVar) -> Self {
26+
pub fn new(sum: Vec<ScaledVar>, b: IntCst, r: BVar) -> Self {
2727
Self { sum, b, r }
2828
}
2929

30-
pub fn sum(&self) -> &Vec<NFLinearSumItem> {
30+
pub fn sum(&self) -> &Vec<ScaledVar> {
3131
&self.sum
3232
}
3333

aries_fzn/src/aries/constraint/lin_ge.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use aries::core::IntCst;
22
use aries::model::Label;
33
use aries::model::Model;
4-
use aries::model::lang::linear::NFLinearSumItem;
4+
use aries::model::lang::linear::ScaledVar;
55

66
use crate::aries::Post;
77
use crate::aries::constraint::LinLe;
@@ -12,16 +12,16 @@ use crate::aries::constraint::LinLe;
1212
/// where `v[i]` are variables, `b` and `c[i]` constants.
1313
#[derive(Debug)]
1414
pub struct LinGe {
15-
items: Vec<NFLinearSumItem>,
15+
items: Vec<ScaledVar>,
1616
lb: IntCst,
1717
}
1818

1919
impl LinGe {
20-
pub fn new(items: Vec<NFLinearSumItem>, lb: IntCst) -> Self {
20+
pub fn new(items: Vec<ScaledVar>, lb: IntCst) -> Self {
2121
Self { items, lb }
2222
}
2323

24-
pub fn items(&self) -> &Vec<NFLinearSumItem> {
24+
pub fn items(&self) -> &Vec<ScaledVar> {
2525
&self.items
2626
}
2727

@@ -32,7 +32,7 @@ impl LinGe {
3232

3333
impl<Lbl: Label> Post<Lbl> for LinGe {
3434
fn post(&self, model: &mut Model<Lbl>) {
35-
let minus = |i: &NFLinearSumItem| NFLinearSumItem {
35+
let minus = |i: &ScaledVar| ScaledVar {
3636
var: i.var,
3737
factor: -i.factor,
3838
};

aries_fzn/src/aries/constraint/lin_ge_half.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use aries::core::IntCst;
22
use aries::model::Label;
33
use aries::model::Model;
44
use aries::model::lang::BVar;
5-
use aries::model::lang::linear::NFLinearSumItem;
5+
use aries::model::lang::linear::ScaledVar;
66

77
use crate::aries::Post;
88
use crate::aries::constraint::LinLeHalf;
@@ -15,17 +15,17 @@ use crate::aries::constraint::LinLeHalf;
1515
/// `lb` and `c[i]` constants.
1616
#[derive(Debug)]
1717
pub struct LinGeHalf {
18-
sum: Vec<NFLinearSumItem>,
18+
sum: Vec<ScaledVar>,
1919
lb: IntCst,
2020
r: BVar,
2121
}
2222

2323
impl LinGeHalf {
24-
pub fn new(sum: Vec<NFLinearSumItem>, lb: IntCst, r: BVar) -> Self {
24+
pub fn new(sum: Vec<ScaledVar>, lb: IntCst, r: BVar) -> Self {
2525
Self { sum, lb, r }
2626
}
2727

28-
pub fn sum(&self) -> &Vec<NFLinearSumItem> {
28+
pub fn sum(&self) -> &Vec<ScaledVar> {
2929
&self.sum
3030
}
3131

aries_fzn/src/aries/constraint/lin_ge_reif.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use aries::core::IntCst;
22
use aries::model::Label;
33
use aries::model::Model;
44
use aries::model::lang::BVar;
5-
use aries::model::lang::linear::NFLinearSumItem;
5+
use aries::model::lang::linear::ScaledVar;
66

77
use crate::aries::Post;
88
use crate::aries::constraint::LinLeReif;
@@ -15,17 +15,17 @@ use crate::aries::constraint::LinLeReif;
1515
/// `lb` and `c[i]` constants.
1616
#[derive(Debug)]
1717
pub struct LinGeReif {
18-
sum: Vec<NFLinearSumItem>,
18+
sum: Vec<ScaledVar>,
1919
lb: IntCst,
2020
r: BVar,
2121
}
2222

2323
impl LinGeReif {
24-
pub fn new(sum: Vec<NFLinearSumItem>, lb: IntCst, r: BVar) -> Self {
24+
pub fn new(sum: Vec<ScaledVar>, lb: IntCst, r: BVar) -> Self {
2525
Self { sum, lb, r }
2626
}
2727

28-
pub fn sum(&self) -> &Vec<NFLinearSumItem> {
28+
pub fn sum(&self) -> &Vec<ScaledVar> {
2929
&self.sum
3030
}
3131

0 commit comments

Comments
 (0)