Clingo: ‘info: tuple ignored’ when attempting to use #minimize statement

  Kiến thức lập trình

I am writing an ASP program that attempts to schedule meetings given their duration, earliest possible start time, latest possible end time, duration, and currently set start time.

I want to write an optimization statement to minimize the difference between the currently set start time and newly assigned one. Or in other words, penalize for moving any meeting from its assigned time.

Here is an example of the requirements for a single meeting:

meeting(meeting0).

%%% CONSTRAINTS FOR Gym Session %%% 
% currently assigned start time
#const curr_start0 = 1064150760.

% start time cannot be before earliest start
:- meeting(meeting0), schedule(meeting0, S, _), S < 1064150760.

% end time cannot be after latest end
:- meeting(meeting0), schedule(meeting0, _, E), E > 1064151000.

% meeting must last duration assigned
:- meeting(meeting0), schedule(meeting0, S, E), S + 120 != E.

% set of possible times to assign
time0(1064150760;1064150790;1064150820;1064150850;1064150880;1064150910;1064150940;1064150970;1064151000).

% meeting must be scheduled ONCE, no more and no less. 
1 {schedule(meeting0, S, E): time0(S), time0(E)} 1 :- meeting(M).

% minimize deviation from currently assigned start time
difference0(D0) :- D0 = abs(curr_start0 - S), schedule(meeting0, S, _).
#minimize { difference0 @ 3 }.

However, I get the following error when running the program, and find that changing the current start time has no effect on the solution produced:

calendar.asp:14:13-24: info: tuple ignored:
  difference0@3

Any help is greatly appreciated, thanks in advance!

New contributor

Sneha Rammohan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT