I'm currently writing an asp program.
when I comment the line #maximize{S:ce(S)}.
within the program, the answer shows as follows
omit the Answer 1 to 6.
Answer: 7
review(harris,english) review(ben,math) review(ben,chinese) review(nick,math) review(ben,english) review(nick,chinese) **ce(4)**
Answer: 8
review(harris,english) review(ben,math) review(ben,chinese) review(nick,math) review(nick,english) review(nick,chinese) **ce(4)**
SATISFIABLE
in which the answer 7 and answer 8 have the same ce
value of 4
.
when I uncomment the line #maximize{S:ce(S)}.
the answer shows as follows
Answer: 1
review(ben,chinese) review(nick,math) ce(2) review(harris,math) review(ben,english) review(nick,english) review(nick,chinese)
Optimization: -2
Answer: 2
review(harris,english) review(ben,math) review(ben,chinese) ce(3) review(harris,math) review(nick,english) review(nick,chinese)
Optimization: -3
Answer: 3
review(harris,english) review(ben,math) review(ben,chinese) review(nick,math) **ce(4)** review(nick,english) review(nick,chinese)
Optimization: -4
OPTIMUM FOUND
there is only one result of ce(4)
, but I'd like to get all the result of the maximum value of ce, what should I do to get the two result with the value ce(4)
.
Maybe you could share your command when executing clingo. I simplified your program as I am not aware of the problem you are encoding.
Basically, the missing condition of your problem is the enumeration of
review(ben,english)
andreview(nick, english)
.If executing with command
clingo 0 filename.lp
the output would generate only one answer set:Similar to your attempt, if I comment the last line, two answer sets will be shown:
But if you uncomment the last line and add
--opt-mode=optN
after the original command, the output would be:Not sure if this is what you want. You might as well refer to clingo guide regarding the parameter of
--opt-mode
: