We help IT Professionals succeed at work.
Get Started

Clear Vector list

Last Modified: 2012-05-11
Hi all

I have the attached code..
For every single interation of method  <<public void one_iteration(int t) >>
a value of g is added to besFit Vector :::  bestFit.add(g);
I need a way of clearing all the assingment to bestFit, before the next Interaton occours... given
the fact that there could be up to 50 interations..

Thanks in Advance      
Given that a sample g = (c1	0	0	1) is a vector
c1	0	0	1
c2	0	1	0
c3	1	0	0
public void one_iteration(int t){
	CellNode bestFit;  //Class CellNode (0,0,0)
	CellNode tempNode;	
	double [] wUpdate;
	double varInflue;
	double [] varW_Vector;
	Gene[] random_order = shuffle();
	for(int j=0; j<8.length; j++){
		Gene g = random_order[j]; //Given than g = ()
		bestFit =   find_best_Fit(g); 
        bestFit.add(g);  //Given that bestFit has a method clear_list : which clears all the g containt of bestFit
		for(int i=0; i<6; i++)
					int xBMap = map[i].get_x();
					int yBMap = map[i].get_y();
					currentNode = new CellNode(xBMap,yBMap, xBMap);
				varW_Vector = map[i].get_weight_vector();
				wUpdate = Function.update_weight_vector(varInflue, varW_Vector,currentNode);
				if (varInflue > 0)

Open in new window

Watch Question
Awarded 2011
Awarded 2011
This problem has been solved!
Unlock 2 Answers and 14 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE