src/NFcore/complex.cpp
//int counter=0;
//int totalSizeSum=0;
//int avgTraversalSize = 0;
/* for unbinding, we have to figure out the elements of the new complex,
 * put those elements in the new complex, renumber the complex_id for those
 * molecules, and delete those molecules from this complex.  wheh! */
int counter=0;
int totalSizeSum=0;
int avgTraversalSize = 0;
for unbinding, we have to figure out the elements of the new complex,
put those elements in the new complex, renumber the complex_id for those
molecules, and delete those molecules from this complex.  wheh!
int counter = 0 ; int totalSizeSum = 0 ; int avgTraversalSize = 0 ; for unbinding we have to figure out the elements of the new complex put those elements in the new complex renumber the complex_id for those molecules and delete those molecules from this complex . wheh!
void Complex::updateComplexMembership(Molecule * m)
{
	if(m->getComplexID()!=this->ID_complex) { cerr<< "ERROR IN COMPLEX!!! "<<endl; return; }
	unsetCanonical();
	list <Molecule *> members;
	m->traverseBondedNeighborhood(members, ReactionClass::NO_LIMIT);
	if(members.size()==(unsigned)this->getComplexSize())
	{
		return;
	}
	Complex *newComplex = (system->getAllComplexes()).getNextAvailableComplex();
	list <Molecule *>::iterator molIter;
	for( molIter = members.begin(); molIter != members.end(); molIter++ ) {
		(*molIter)->moveToNewComplex(newComplex->getComplexID());
	}
	newComplex->complexMembers.splice(newComplex->complexMembers.end(),members);
	complexMembers.remove_if(IsInWrongComplex(this->ID_complex));
	done!
}
void Complex :: updateComplexMembership ( Molecule * m ) { if ( m -> getComplexID ( ) != this -> ID_complex ) { cerr << " " << endl ; return ; } unsetCanonical ( ) ; list < Molecule * > members ; m -> traverseBondedNeighborhood ( members , ReactionClass :: NO_LIMIT ) ; if ( members . size ( ) == ( unsigned ) this -> getComplexSize ( ) ) { return ; } Complex * newComplex = ( system -> getAllComplexes ( ) ) . getNextAvailableComplex ( ) ; list < Molecule * > :: iterator molIter ; for ( molIter = members . begin ( ) ; molIter != members . end ( ) ; molIter ++ ) { ( * molIter ) -> moveToNewComplex ( newComplex -> getComplexID ( ) ) ; } newComplex -> complexMembers . splice ( newComplex -> complexMembers . end ( ) , members ) ; complexMembers . remove_if ( IsInWrongComplex ( this -> ID_complex ) ) ; }
int counter=0;
int totalSizeSum=0;
int avgTraversalSize = 0;
for unbinding, we have to figure out the elements of the new complex,
 put those elements in the new complex, renumber the complex_id for those
 molecules, and delete those molecules from this complex.
int counter = 0 ; int totalSizeSum = 0 ; int avgTraversalSize = 0 ; for unbinding we have to figure out the elements of the new complex put those elements in the new complex renumber the complex_id for those molecules and delete those molecules from this complex .
//Check if this molecule is indeed in this complex first, can be removed later for //optimization //Get list of things this molecule is still connected to //counter++; //cout<<"traversing neighborhood: "<<counter<<endl; //totalSizeSum+=members.size(); //avgTraversalSize = totalSizeSum/counter; //cout<<members.size()<<endl; //cout<<"average: "<<avgTraversalSize<<endl; //Check if we even need to create a new complex (if not, return) //cout<<"still in same complex, so no new complex"<<endl; //Get the next available complex // NETGEN -- redirected call to ComplexList object at system->allComplexes //cout<<" forming new complex:  next available: " <<newComplex->getComplexID()<<endl; //renumber our complex elements //put our new complex elements into that complex //cout<<"size of list now: " << members.size() <<endl; //remove all molecules from this that don't have the correct complex id //update new complex in reactions? // //done!