i am trying that but i cant make it work. I have a loop inside a loop and that makes things worse
Type: Posts; User: speaker
i am trying that but i cant make it work. I have a loop inside a loop and that makes things worse
inside the loop i find dynamically the values of float numbers and the correspodining values of string1 and string 2
if i try to create the set inside the loop then the values are not...
my bad! though i tried to delete one of them:o
its loaded outside the loop ,and moving that control inside the loop would cause more problems
Hello,
in my code i have at some point 3 parallel vectors [float(i)<=>string1(i)<=>string2(i)]
i wanted to eliminate equal float numbers of the 1st vector ,therefore i create a SET...
Hello,
in my code i have at some point 3 parallel vectors [float(i)<=>string1(i)<=>string2(i)]
i wanted to eliminate equal float numbers of the 1st vector ,therefore i create a SET...
im sorry
noob mistake
i have two vectors containing ITEMS .At the end of the loops of the vectors i get 2 Items and i have to compare them .
they look like this:
ITEM...
I think this answer will be helpful. I will try to work it out now.
Below there is the output of the two vectors A and B as an example.
i hope its helpful
...
Hello,
i have two vectors containing strings.These two vectors they dont have the same length.
I need to compare the strings between vector A and vector B ,and find sets of similar strings.
At...
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...
Hello,
Would a hashMap be a solution?
you are absolutely right. I will change the variable's name as you said .Parallelism is needed,but its difficult to be achieved.
It is compiled but i dont get the correct corresponding values ,so...
i posted the code.i hope it helps.
the vectors are declared together,if that is what you ask me:-)
ok i know you are right but it didnt work for me,and i think i know why.
when i declare the Item inside the loop it shows me a warning(local variable hides a field!)..is this the problem?
for...
There is already a vector containing Items(=strings) ,and i created another vector for the float numbers.
Every Item corresponds to a float number which is the result of a ranking algorithm.
I...