×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Fuzzy sets placing values
2

Fuzzy sets placing values

Fuzzy sets placing values

(OP)
Hi,

Just wanted to know how to put some values in arrays.

i.e.

One would be car- ford, toyata, audi.

2nd one would be = long, round, large

The 3rd would be ={1.8,0.5,2.0}

Then by typing i.e. some values in like the third array you find out which car you were looking at.

----

How would I go about doing this or is there a website I could go on?

Thanks

RE: Fuzzy sets placing values

2
Based on your example, I think you'd want to use maps.  

You'll need to provide more information if you want a better answer.   

-----------------------------------------
I cannot be bought.  Find leasing information at http://www.joshaxtell.com/

RE: Fuzzy sets placing values

(OP)
thank for the reply.

I think this may make it a bit clearer

A fruit example,

A group of fruits ={banana, mango}

Shape={long, round, large}

I think assign numbers i.e. a banana is 1.0 large, 0.0 round and 0.5 large.
--------------------------

Then someone can type in for the three shape choices i.e. I want something 0.9 large, 0.2 round and 0.3 large. Therefore he/she would get the closest thing which would be a banana in this case.

thanks

RE: Fuzzy sets placing values

I think what I would do is this:

Calculate the sum of the absolute value of the differences
[1.0-.9] + [0.0-0.2] + [0.5-0.3] = 0.5

Store that value in a TreeMap.

CODE

TreeMap myMap = new TreeMap();
float calculatedSumofAbsoulteDifference;
String fruitName;
String answer;

/* for loop to calculate values*/
...
myMap.put(calculatedSumofAbsoluteDifference,fruitName);
....
/* end for loop*/
answer = myMap.get(myMap.firstKey());

There might be a better way, but I can't think of one at the moment.

-----------------------------------------
I cannot be bought.  Find leasing information at http://www.joshaxtell.com/

RE: Fuzzy sets placing values

This should be asked in the Java forum.

I'd use a HashMap with key=name of fruit, value=array of three numbres.

I'd iterate calculating the differences and getting the min.

Cheers,
Dian

RE: Fuzzy sets placing values

(OP)
thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close