[eclipse-clp-users] (no subject)

From: Edgaonkar, Shrirang <Shrirang.Edgaonkar_at_nttdata.com>
Date: Fri, 21 Nov 2014 01:05:36 +0000
Dear Eclipse users group,



  I am working on solving constraints based on real numbers. Following is the sample code with all the constraints and locate API to find the solution.





:- module(test).
:- export hello/0.
:-lib(ic).

hello :-

  A :: -9223372036854775808.0__9223372036854775807.0,
  B :: -9223372036854775808.0__9223372036854775807.0,
  C :: -9223372036854775808.0__9223372036854775807.0,
  D :: -9223372036854775808.0__9223372036854775807.0,

  A $> B,
  B $< C,
  B + C $= 78,
  ((D - B) * 45) / A $= 123.35,

  locate([A, B, C, D], 1e-1, lin),

  writeln(a=[A]),
  writeln(b=[B]),
  writeln(c=[C]),
  writeln(d=[D]),
  writeln("%%%%%%%%%%%%%%%%%%%%%%%%%").







Following is the output but the output is always in ranges and I need solution that is a single set of real numbers. Please help me on how can I achieve this.





Output



a = [_436{16.8253096002924 .. 17.8537558438417}]
b = [_575{16.8253096002924 .. 17.8537558438417}]
c = [_714{60.1462441561583 .. 61.1746903997076}]
d = [_853{62.9453526935382 .. 66.7928843624611}]
%%%%%%%%%%%%%%%%%%%%%%%%%





Thanks and Regards,

Shrirang Edgaonkar

______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.
Received on Fri Nov 21 2014 - 01:05:53 CET

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2014 - 01:16:36 CET