×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• 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.

# Fuzzy sets placing values2

## 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.

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

### RE: Fuzzy sets placing values

(OP)

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;

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

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.

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:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!