Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(val): support scheduling problems #100

Merged
merged 115 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
b1034c8
feat(solver): Add bounds to int type.
arbimo Jun 7, 2023
8ab603b
chore(build): Put all regex dependency in workspace.
arbimo Jun 8, 2023
8ac9e41
feat(up): Allow parsing bounded integer types.
arbimo Jun 8, 2023
3a50715
chore(planning): Rename StateFun to Fluent
arbimo Jun 8, 2023
949b109
chore(planning): Refactor state variable representation to have the `…
arbimo Jun 9, 2023
4168013
feat(up): Add support for parsing (not solving) simple numeric problems.
arbimo Jun 9, 2023
0c0a054
chore(up): Add features that will be supported after simple numeric p…
arbimo Jun 9, 2023
3a11167
docs(resources): draft
Shi-Raida Jun 14, 2023
d4203be
docs(resources): only consider instantaneous conditions/effects
Shi-Raida Jun 14, 2023
1902456
feat(encode): convert resource constraints into linear sums
Shi-Raida Jun 15, 2023
730e347
refactor(lin sum): replace or_zero by a lit
Shi-Raida Jun 15, 2023
4f34335
chore(encode): use lit in lin sum of resource constraints
Shi-Raida Jun 19, 2023
d7cafbd
chore(encode): debug num resource constraints
Shi-Raida Jun 19, 2023
77a858e
chore(encode): filter non present effects and conditions
Shi-Raida Jun 19, 2023
73c61d4
chore(encode): adapt coherence, support and mutex for increases
Shi-Raida Jun 19, 2023
439890c
fix(encode): support constraint for numeric state variables
Shi-Raida Jun 19, 2023
c46f7aa
chore(reif): eval of lin constraint
Shi-Raida Jun 19, 2023
2273819
feat(linear): optional var to create constant terms
Shi-Raida Jun 22, 2023
687189f
fix(encode): stop skipping unbounded integers
Shi-Raida Jun 22, 2023
edae6a9
fix(model): bind entailed literal to tautology of expression scope
Shi-Raida Jun 22, 2023
7516e9a
chore(merge): 'master' into 'numeric-planning'
Shi-Raida Jun 26, 2023
10a01ba
fix(causal): format of state variables
Shi-Raida Jun 26, 2023
490a703
chore(up): update to last version
Shi-Raida Jun 26, 2023
395dce1
fix(model): use core reification with tautology for lin constr
Shi-Raida Jun 27, 2023
11b19ad
fix(model): skip non-present constraints during assignment validation
Shi-Raida Jun 28, 2023
b903a92
fix(ci): update upf proto version
Shi-Raida Jun 28, 2023
dbb0499
chore(up): update support kind for solver and validator
Shi-Raida Jun 28, 2023
0f18adb
fix(val): adaptation for upf scheduling
Shi-Raida Jun 28, 2023
0a20b4b
chore(up): update supported kind for solver
Shi-Raida Jun 29, 2023
4b4e6ea
chore(up): Update unified planning dependency to support scheduling p…
arbimo Jun 19, 2023
ae2a0ee
fix(planning): Be conservative in evaluating whether a numeric fluent…
arbimo Jul 4, 2023
4394ce0
chore(up): Add convenience method to query a problem type.
arbimo Jul 4, 2023
49ba5d5
chore(up): Set default log level to INFO.
arbimo Jul 4, 2023
df7dc25
chore(up): If a problem has no templates, then fix expansion depth.
arbimo Jul 4, 2023
e4b958b
chore: Convenience method to check is a type is numeric.
arbimo Jul 4, 2023
3367779
chore(up): Add direct support for LEQ (previously required compiling …
arbimo Jul 4, 2023
b751054
chore(up): Add direct support for LEQ (previously required compiling …
arbimo Jul 4, 2023
c8440ad
chore: Update unified-planning version
arbimo Jul 4, 2023
aea9201
fix(val): effect factory with forall param
Shi-Raida Jul 10, 2023
e82eb58
chore(cp): add LinearSumLeq.active in explanation
Shi-Raida Jul 10, 2023
4bf4851
fix(cp): lower and upper bound getters
Shi-Raida Jul 11, 2023
9e2dc4b
refactor: cp tests
Shi-Raida Jul 11, 2023
83910c8
fix(cp): set current value of a constant as upper bound
Shi-Raida Jul 11, 2023
96ced3e
test(cp): multiple variables
Shi-Raida Jul 11, 2023
0ed079a
test(cp): check propagation and ub setting results
Shi-Raida Jul 11, 2023
1068f08
test(cp): check negative and null factors
Shi-Raida Jul 11, 2023
4cc8f24
test(cp): check sum with literals
Shi-Raida Jul 11, 2023
7e59903
chore: ignore coverage files
Shi-Raida Jul 11, 2023
bfe6260
chore: ignore .env file
Shi-Raida Jul 12, 2023
a8300c8
test(cp): explanations
Shi-Raida Jul 12, 2023
836243e
chore(cp): try to force non-precense of elem when ub cannot be set
Shi-Raida Jul 12, 2023
3c19ee9
chore(merge): 'master' into 'numeric-planning'
Shi-Raida Jul 12, 2023
d70e17d
fix(solver): Conversion from FAtom to LinearSum was erroneous.
arbimo Jul 26, 2023
014d888
feat(up): Allow outputing scheduling solutions..
arbimo Jul 27, 2023
034445c
chore(solver): make LinearTerm attributes private
Shi-Raida Jul 27, 2023
f6ae0f5
test(linear): add unit tests
Shi-Raida Aug 16, 2023
85ee951
chore(linear|simplify): group constant terms into upper bound
Shi-Raida Aug 17, 2023
8a1c137
feat(var): create variable ONE
Shi-Raida Aug 17, 2023
5dae98d
chore(linear): use ONE variable for constants
Shi-Raida Aug 17, 2023
1ba7c6f
fix(solver): simplified linear sum in constraint posting
Shi-Raida Aug 17, 2023
1533aaa
fix(grpc): plan generation result on timeout
Shi-Raida Aug 17, 2023
2f69afc
fix: cargo clippy warning
Shi-Raida Aug 17, 2023
af50b74
chore(linear|propagator): filter watches
Shi-Raida Aug 18, 2023
aeb4963
chore(solver): use simplified linear sum
Shi-Raida Aug 18, 2023
f864812
fix(cp): set non-precense rather than decide it
Shi-Raida Aug 18, 2023
988316f
chore(linear|propagator): watch precense literal
Shi-Raida Aug 18, 2023
623a342
chore(merge): 'fix/val/97' into 'feat/val/sched'
Shi-Raida Aug 21, 2023
dd29fcd
chore(val): declare supporting SCHEDULING & BOUNDED_TYPES
Shi-Raida Aug 21, 2023
43e4ccb
chore(val): add Duration factory
Shi-Raida Aug 21, 2023
bb99f6e
chore(val): add Activity factory
Shi-Raida Aug 21, 2023
bf7c57d
chore(val): add Fluent factory
Shi-Raida Aug 21, 2023
6517895
chore(val): return Result when bounding a fluent
Shi-Raida Aug 21, 2023
67d7081
refactor(val): add bounds to Value::Number
Shi-Raida Aug 21, 2023
6a69208
feat(val): evaluation of bounded numbers
Shi-Raida Aug 21, 2023
9d0a47c
chore(val): store fluent type in its name
Shi-Raida Aug 21, 2023
71a59d1
refactor(val): move extract_bounds util function
Shi-Raida Aug 21, 2023
d75897f
chore(val): check fluent bounds when setting the value
Shi-Raida Aug 21, 2023
8ecf3a0
test(val): bounds in effects
Shi-Raida Aug 21, 2023
c73166d
fix(val): signature of a state variable
Shi-Raida Aug 22, 2023
350adec
chore(val): add mock schedule problem
Shi-Raida Aug 22, 2023
c4c9b13
chore(val): add mock schedule plan
Shi-Raida Aug 22, 2023
6a6ab02
chore(val): check if problem is schedule
Shi-Raida Aug 22, 2023
04258bb
chore(val): update temporal detection for discrete time
Shi-Raida Aug 22, 2023
f1fea9c
chore(val): check if plan is schedule and is coherent with problem
Shi-Raida Aug 22, 2023
d55926c
refactor(val): get epsilon from problem in dedicated method
Shi-Raida Aug 22, 2023
2178b38
fix(val): mock schedule plan creation
Shi-Raida Aug 22, 2023
9e93bf7
chore(val): allow increase effects on the same fluent at the same time
Shi-Raida Aug 22, 2023
bf85748
fix(val): negative bounds extraction
Shi-Raida Aug 24, 2023
fe22b2b
refactor(val): check fluent bounds in dedicated method
Shi-Raida Aug 24, 2023
8f0f73d
refactor(val): use env.state for Act::apply()
Shi-Raida Aug 24, 2023
563b4fc
chore(val): check fluent bounds after applying an action
Shi-Raida Aug 24, 2023
44e6e6a
fix(val): minimal delay error message
Shi-Raida Aug 24, 2023
a932def
feat(val): support schedule problems
Shi-Raida Aug 24, 2023
2c623bc
feat(grpc): support upf epsilon
Shi-Raida Aug 24, 2023
b91fd58
chore(val): add TODO
Shi-Raida Aug 29, 2023
e878f06
refactor(val): split action application into atomic methods
Shi-Raida Aug 29, 2023
dafd9c4
style(val): typo in comments
Shi-Raida Aug 29, 2023
bee62fe
refactor(val): distinction between continuous and discrete time
Shi-Raida Aug 29, 2023
826715b
chore(val): save is discrete time problem in env
Shi-Raida Aug 29, 2023
024cdcf
fix(val): action applicability for problems with discrete time
Shi-Raida Aug 29, 2023
331e7bd
fix(val): check init env for effect applicability in actions
Shi-Raida Aug 29, 2023
05affc5
refactor(val): rename csp start/end ids
Shi-Raida Aug 29, 2023
6825438
chore(val): save is schedule problem in env
Shi-Raida Aug 29, 2023
21a3ef6
refactor(val): move rational from atom method
Shi-Raida Aug 29, 2023
b5a40bb
feat(val): check schedule problem constraints
Shi-Raida Aug 29, 2023
4ffc0df
fix: cargo clippy warning
Shi-Raida Aug 29, 2023
7819122
build: update unified-planning version
Shi-Raida Aug 30, 2023
5a05fc8
chore(grpc|val): add verbose mode from env param
Shi-Raida Aug 30, 2023
0b823e8
feat(val): support timed effects
Shi-Raida Aug 30, 2023
5e5861b
docs(val): better error message
Shi-Raida Aug 30, 2023
414111b
feat(val): support activities with parameters
Shi-Raida Aug 30, 2023
342f780
feat(val|sched): handle goals
Shi-Raida Aug 30, 2023
26b2005
fix: cargo clippy warning
Shi-Raida Aug 30, 2023
f784f2f
chore(up): update deps version
Shi-Raida Sep 1, 2023
5b5eb1f
chore(model): Minor doc improvement.
arbimo Sep 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(model): skip non-present constraints during assignment validation
  • Loading branch information
Shi-Raida committed Jun 28, 2023
commit 11b19adcdc475487c01324e1d0beb01f5c65e2ce
30 changes: 12 additions & 18 deletions solver/src/model/model_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,22 @@ impl<Lbl: Label> ModelShape<Lbl> {
pub(crate) fn validate(&self, assignment: &Domains) -> anyhow::Result<()> {
for c in &self.constraints {
let Constraint::Reified(expr, reified) = c;
let actual_value = expr.eval(assignment);
let expected_value = if assignment.present(reified.variable()).unwrap() {
Some(assignment.value(*reified).unwrap())
} else {
None
};
let ok = if expected_value.is_some() {
expected_value == actual_value
if assignment.present(reified.variable()).unwrap() {
let actual_value = expr.eval(assignment);
let expected_value = Some(assignment.value(*reified).unwrap());
anyhow::ensure!(
actual_value == expected_value,
"{:?}: {:?} != {:?} [{:?}]",
expr,
actual_value,
expected_value,
reified
);
} else {
// Underspecified: we may be able to determine a value on the
// expression side (e.g. with short-circuiting "or") even though we are not in the
// validity scope of the literal.
true
};
anyhow::ensure!(
ok,
"{:?}: {:?} != {:?} [{:?}]",
expr,
actual_value,
expected_value,
reified
);
}
}
Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions solver/src/solver/solver_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ impl<Lbl: Label> Solver<Lbl> {
ReifExpr::Linear(lin) => {
let lin = lin.simplify();
let handled = match lin.sum.len() {
// TODO - Manage sums with multiple constants. Set them into the `upper_bound` during the simplification above?
0 => {
// Check that the constant of the constraint is positive.
self.post_constraint(&Constraint::Reified(
Expand Down
Loading