traffic-generator/src/ModelRead.cpp
/**
 * Read in the probabilities for number of invalidates and their respective
 * destinations for each source node.
 *
 * @param modelFile The model file stream
 */
Read in the probabilities for number of invalidates and their respective
destinations for each source node.

@param modelFile The model file stream
Read in the probabilities for number of invalidates and their respective destinations for each source node . @param modelFile The model file stream
void ReadInvalidates(ifstream& modelFile) {
	string header;
	int cl, source, number, freq;
	modelFile >> header;
	while(!PeekForHeader(modelFile, "END")) {
		for(int i = 0; i < g_numNodes/2; i++) {
			modelFile >> cl >> source >> number >> freq;
			if(i != number) {
				cerr << "Invalid model file. Reading invalidate probabilities."
						<< endl;
				return;
			}
			g_numInv[g_hierClass][cl][source].Add(freq);
		}
	}
	modelFile >> header;
	int destination, value;
	map<int, map<int, map<int, int> > > iteration;
	modelFile >> header;
	while(!PeekForHeader(modelFile, "END")) {
		modelFile >> source >> destination >> cl >> value;
		g_invDest[g_hierClass][cl][source].Add(value);
	}
	modelFile >> header;
}
void ReadInvalidates ( ifstream & modelFile ) { string header ; int cl , source , number , freq ; modelFile >> header ; while ( ! PeekForHeader ( modelFile , " " ) ) { for ( int i = 0 ; i < g_numNodes / 2 ; i ++ ) { modelFile >> cl >> source >> number >> freq ; if ( i != number ) { cerr << " " << endl ; return ; } g_numInv [ g_hierClass ] [ cl ] [ source ] . Add ( freq ) ; } } modelFile >> header ; int destination , value ; map < int , map < int , map < int , int > > > iteration ; modelFile >> header ; while ( ! PeekForHeader ( modelFile , " " ) ) { modelFile >> source >> destination >> cl >> value ; g_invDest [ g_hierClass ] [ cl ] [ source ] . Add ( value ) ; } modelFile >> header ; }
Read in the probabilities for number of invalidates and their respective
 destinations for each source node.
Read in the probabilities for number of invalidates and their respective destinations for each source node .