Program5/Graph.cpp
//Takes in a pointer to a sender and places it on the grid, sets its location, and adds it to the list of all the elements.
Takes in a pointer to a sender and places it on the grid, sets its location, and adds it to the list of all the elements.
Takes in a pointer to a sender and places it on the grid sets its location and adds it to the list of all the elements .
void Graph::addToGrid(Sender* thisSender){
	srand(time(NULL));
	int rand1;
	bool noSpot = true;
	while (noSpot){
		rand1 = rand() % dimension;
		if (manetmap[rand1][0] == -1){
			noSpot = false;
			thisSender->setLoc(rand1, 0);
			manetmap[rand1][0] = thisSender->getID();
			(*items)[(thisSender->getID() - 1)] = (FCFS*)thisSender;
		} 
	}
}
void Graph :: addToGrid ( Sender * thisSender ) { srand ( time ( NULL ) ) ; int rand1 ; bool noSpot = true ; while ( noSpot ) { rand1 = rand ( ) % dimension ; if ( manetmap [ rand1 ] [ 0 ] == -1 ) { noSpot = false ; thisSender -> setLoc ( rand1 , 0 ) ; manetmap [ rand1 ] [ 0 ] = thisSender -> getID ( ) ; ( * items ) [ ( thisSender -> getID ( ) - 1 ) ] = ( FCFS * ) thisSender ; } } }
Takes in a pointer to a sender and places it on the grid, sets its location, and adds it to the list of all the elements.
Takes in a pointer to a sender and places it on the grid sets its location and adds it to the list of all the elements .