Skip to content
Open
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
prefer against zero bin
  • Loading branch information
haldenl committed Mar 21, 2019
commit 52f9275faf243974a26a888d72868db323eee73f
1 change: 1 addition & 0 deletions asp/assign_weights.lp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ soft_weight(aggregate_group_by_raw,aggregate_group_by_raw_weight).
soft_weight(x_y_raw,x_y_raw_weight).
soft_weight(log,log_weight).
soft_weight(zero,zero_weight).
soft_weight(zero_bin,zero_bin_weight).
soft_weight(zero_size,zero_size_weight).
soft_weight(zero_positional,zero_positional_weight).
soft_weight(zero_skew,zero_skew_weight).
Expand Down
3 changes: 3 additions & 0 deletions asp/soft.lp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ soft(log,V,E) :- log(V,E).
% @constraint Prefer to include zero for continuous (binned doesn't need zero).
soft(zero,V,E) :- continuous(V,E), not zero(V,E).

% @constraint Prefer to exclude zero for binned.
soft(zero_bin,V,E) :- bin(V,E,_), zero(V,E).

% @constraint Prefer zero size (even when binned).
soft(zero_size,V) :- channel(V,E,size), not zero(V,E).

Expand Down
3 changes: 2 additions & 1 deletion asp/weights.lp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#const aggregate_group_by_raw_weight = 10.
#const x_y_raw_weight = 1.
#const log_weight = 1.
#const zero_weight = 3.
#const zero_weight = 1.
#const zero_bin_weight = 1.
#const zero_size_weight = 3.
#const zero_positional_weight = 1.
#const zero_skew_weight = 5.
Expand Down