that was very helpful. i realised that one of the vectors had always 6 elements ,while the other was incremented by 6 after every loop[duh!]
So i clear the problematic vector after every loop: ...
Type: Posts; User: speaker
that was very helpful. i realised that one of the vectors had always 6 elements ,while the other was incremented by 6 after every loop[duh!]
So i clear the problematic vector after every loop: ...
this is the line: newItem=(Item) src.elementAt(totVector.indexOf(rTOT1min));
yes it returns that value.it shouldnt.
hmmm....it suppose to find the corresponding Item for the minValue(float)
###### CALCOLO SCORE ######
AirCondition_A_Cooling + coffee_request>>>>>rTOT=0.25
AirCondition_A_Cooling + ENEL >>>rTOT1 0.55
AirCondition_A_Cooling + EolicGenerator1KW >>>rTOT1 0.53846157...
ok im sorry im panicking here..i get an integer which denotes the index
hmmmm..it gives me a the min Float number..i thought it would give me an integer
well it seems to be working like this,but after a number of loops i get an ArrayOutOfBoundsException after a few loops
heres the output
###### CALCOLO SCORE ######
AirCondition_A_Cooling +...
so,i thought i should add something like this :
Item newItem = (Item) src.elementAt(totVector.indexOf(rTOT1min)) ; <-------inside the parenthesis goes the index ,correct?...
Vector src =new Vector();
Vector totVector=new Vector();
for (int j = 0; j < energySource.size(); j++) {
Item...
ok..the loop is done in order to put float values into one vector,and string values to another vector.
after the loop i find easily the min value of the float vector,but i still cant associate it...
yes this is me! i use an index as you say ,but it returns the values only if executed inside the for loop.
**hello**
ive created two vectors parallely ,one for strings and one for floats.Every string corresponds to a float.Thii is done inside a FOR loop. After the loop i calculate the min of floats and i...