troubleshooting Question

Clear Vector list

Avatar of ZURINET
ZURINET asked on
Java
14 Comments2 Solutions397 ViewsLast Modified:
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)
				{	
					map[i].set_weight_vector(wUpdate);
				}
		}
	}
}

Open in new window

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros