For Programmers: Free Programming Magazines  


Home > Archive > Prolog > March 2005 > Request about Ciao Fuzzy Prolog









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Request about Ciao Fuzzy Prolog
Paolo

2005-03-31, 3:59 pm

Hi,
after several searches i'm using Ciao Prolog for my thesis, because it
contain an extension for Fuzzy Theory.
I must apply the Fuzzy Theory to Constraint Programming and i've
chosen like example the knapsack problem without the maximization.

I've defined one list of objects

K = [oggetto('A',3,402),oggetto('B',1,422),o
ggetto('C',2.3,80),
oggetto('D',0.7,145),oggetto('E',0.3,611)]

where 'A' is the name, 3 the volume, 402 the price, etc...

The rest of code is:

knapsack(O, Vu, Pu) :-
K = [oggetto('A',3,402),oggetto('B',1,422),o
ggetto('C',2.3,80),
oggetto('D',0.7,145),oggetto('E',0.3,611)],
vincolo(K,O,Vu, Pu).

vincolo(K,O,Vu,Pu):~
subseq(O, K),
volume(O, V),
prezzo(O, P),
volfuzzy(V,Vu),
prefuzzy(P,Pu),
{Vu .=<. 1.0},
{Pu .>=. 0.5}.

% alto se > 10
volfuzzy :# fuzzy_predicate([(0,0),(5,0.5),(10,1)]).

% alto se > 2500 €
prefuzzy :# fuzzy_predicate([(0,0),(1500,0.5),(3000,1)]).

where

sublist(A,B) return all the sublist of K, volume(X,Y) return in Y the
sum of volumes of the list X, prezzo(X,P) the price.
The constraint that i've defined are:
{Vu .=<. 1.0},
{Pu .>=. 0.5}.

Now i would want that the values of the objects of the list K were
fuzzy value, that is i would want to say that the object ' A' does not
have a
volume of 3 liters but a fuzzy value.
How can be made this thing in Hello Prolog?
Can you help me, please?
Thanks a lot,
Paul.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com