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

Single-shot solving benchmarks implementation #56

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Fixed symmetry-breaking encoding
  • Loading branch information
Kriplingo committed Aug 12, 2024
commit ee0d852b327e9262b445c0ed54b4513e5025f4e6
45 changes: 45 additions & 0 deletions singleshot_bench/ooasp_check_user.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

% ==============================================================================
% User input Values (General), when guessing values this should not be needed
% ==============================================================================

% %--- (USER INPUT) Attribute value must belong to instance class
ooasp_cv(no_instance_for_attribute,OBJECT,"Attribute {} not of selected class",(A,)) :-
ooasp_attr(C1,A,T),
user(ooasp_attr_value(A,OBJECT,V)),
not ooasp_isa(C1,OBJECT).

%--- (USER INPUT) Attribute value must belong to instance
ooasp_cv(no_instance_for_attribute,OBJECT,"Value for {} assigned but instanciated",(A,)) :-
user(ooasp_attr_value(A,OBJECT,V)),
not ooasp_isa(_,OBJECT).

%--- (USER INPUT) Atribute value not from domain
ooasp_cv(value_not_domain,OBJECT,"Value {} for {} not from domain",(V,A)) :-
ooasp_attr(C,A,enumint),
ooasp_attr_enum(C,A,_),
ooasp_isa(C,OBJECT),
user(ooasp_attr_value(A,OBJECT,V)),
not ooasp_attr_enum(C,A,V).

%--- (USER INPUT) Multiple values for a value
ooasp_cv(conflicting_values,OBJECT,"Multiple values for {}: {},{}",(A,V1,V2)) :-
ooasp_attr(C,A,T),
user(ooasp_attr_value(A,OBJECT,V1)),
user(ooasp_attr_value(A,OBJECT,V2)),
V1<V2.

%--- (USER INPUT) Value outside range
ooasp_cv(value_outside_of_range,OBJECT,"Value for {} outside range {}<{}",(A,V,MIN)) :-
ooasp_attr(C,A,T),
ooasp_isa(C,OBJECT),
user(ooasp_attr_value(A,OBJECT,V)),
ooasp_attr_minInclusive(C,A,MIN),
V<MIN.

ooasp_cv(value_outside_of_range,OBJECT,"Value for {} outside range {}>{}",(A,V,MAX)) :-
ooasp_attr(C,A,T),
ooasp_isa(C,OBJECT),
user(ooasp_attr_value(A,OBJECT,V)),
ooasp_attr_maxInclusive(C,A,MAX),
V>MAX.
20 changes: 20 additions & 0 deletions singleshot_bench/ooasp_user_input.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
% Copyright (c) 2022 Siemens AG Oesterreich
% SPDX-License-Identifier: MIT

%--------
% Externals for user selections to allow checks of partial rations
%--------

% ---- Classes
ooasp_isa(C,OBJECT) :-
user(ooasp_isa(C,OBJECT)).

% ---- Associations
ooasp_associated(AS,OBJECT,ID2) :-
user(ooasp_associated(AS,OBJECT,ID2)).
ooasp_associated(AS,ID1,OBJECT) :-
user(ooasp_associated(AS,ID1,OBJECT)).

% ---- Attribute values
ooasp_attr_value(A,OBJECT,V) :-
user(ooasp_attr_value(A,OBJECT,V)).
5 changes: 3 additions & 2 deletions singleshot_bench/singleshot.lp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "ooasp.lp".
#include "ooasp_symmetry.lp".
#include "ooasp_user_input.lp".
#include "ooasp_check_user.lp".

#include "instances/assumptions.lp".

#include "racks/constraints.lp".
#include "racks/fb.lp".