traffic-generator/src/ModelRead.cpp
/**
 * Read in the spatial injection probabilities for each message type.
 *
 * @param modelFile The model file stream
 */
Read in the spatial injection probabilities for each message type.
@param modelFile The model file stream
Read in the spatial injection probabilities for each message type . @param modelFile The model file stream
void ReadSpatial(ifstream& modelFile) {
	string header;
	int value;
	modelFile >> header;
	while(!PeekForHeader(modelFile, "END")) {
		for(int cl  = 1; cl <= g_numClasses; cl++) {
			modelFile >> value;
			g_writeSpat[g_hierClass][cl].Add(value);
		}
	}
	modelFile >> header;
	modelFile >> header;
	while(!PeekForHeader(modelFile, "END")) {
		for(int cl  = 1; cl <= g_numClasses; cl++) {
			modelFile >> value;
			g_readSpat[g_hierClass][cl].Add(value);
		}
	}
	modelFile >> header;
	modelFile >> header;
	while(!PeekForHeader(modelFile, "END")) {
		for(int cl  = 1; cl <= g_numClasses; cl++) {
			modelFile >> value;
			g_ccrSpat[g_hierClass][cl].Add(value);
		}
	}
	modelFile >> header;
	modelFile >> header;
	while(!PeekForHeader(modelFile, "END")) {
		for(int cl  = 1; cl <= g_numClasses; cl++) {
			modelFile >> value;
			g_dcrSpat[g_hierClass][cl].Add(value);
		}
	}
	modelFile >> header;
}
void ReadSpatial ( ifstream & modelFile ) { string header ; int value ; modelFile >> header ; while ( ! PeekForHeader ( modelFile , " " ) ) { for ( int cl = 1 ; cl <= g_numClasses ; cl ++ ) { modelFile >> value ; g_writeSpat [ g_hierClass ] [ cl ] . Add ( value ) ; } } modelFile >> header ; modelFile >> header ; while ( ! PeekForHeader ( modelFile , " " ) ) { for ( int cl = 1 ; cl <= g_numClasses ; cl ++ ) { modelFile >> value ; g_readSpat [ g_hierClass ] [ cl ] . Add ( value ) ; } } modelFile >> header ; modelFile >> header ; while ( ! PeekForHeader ( modelFile , " " ) ) { for ( int cl = 1 ; cl <= g_numClasses ; cl ++ ) { modelFile >> value ; g_ccrSpat [ g_hierClass ] [ cl ] . Add ( value ) ; } } modelFile >> header ; modelFile >> header ; while ( ! PeekForHeader ( modelFile , " " ) ) { for ( int cl = 1 ; cl <= g_numClasses ; cl ++ ) { modelFile >> value ; g_dcrSpat [ g_hierClass ] [ cl ] . Add ( value ) ; } } modelFile >> header ; }
Read in the spatial injection probabilities for each message type.
Read in the spatial injection probabilities for each message type .