Re: Min of all solutions

Carlo Capelli <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CABty9wy-3mHB5_GjUUSNoZ2v+wKYofs4O1AeHgZVaSMLjhteow@mail.gmail.com>
I posted on github<https://github.com/CapelliC/prolog-snippets/blob/master/lag.pl>a
small module, where you can find integrate/3, to be used this way

:- use_module(lag).

bridge_crossing(Times, MinTime, MinSeq) :-
   integrate(min, seq(Times), (MinTime, MinSeq)).

seq(Times, (Time,Seq)) :-
   across(Times, [], Seq), sum_list(Seq, Time).


It avoid building a list of all solutions, then you could be interested if
your search space is large and/or solutions are cumbersome.

HTH Carlo



2013/8/13 Diego Rafael Di Berardino <[email protected]>

> how can i get the solution that hs the min value of all solutions of a
> goal?
> -------------- next part --------------
> HTML attachment scrubbed and removed
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.