traffic-generator/src/ModelRead.cpp
/**
 * Read the forwarding probabilities for node directories.
 *
 * @param modelFile The model file stream
 */
Read the forwarding probabilities for node directories.
@param modelFile The model file stream
Read the forwarding probabilities for node directories . @param modelFile The model file stream
void ReadForwards(ifstream& modelFile) {
	int index;
	double value1, value2;
	string header;
	modelFile >> header;
	while(!PeekForHeader(modelFile, "END")) {
		modelFile >> index >> value1 >> value2;
		g_toForward[g_hierClass][index][WRITE].Add(value1);
		g_toForward[g_hierClass][index][WRITE].Add(1 - value1);
		g_toForward[g_hierClass][index][READ].Add(value2);
		g_toForward[g_hierClass][index][READ].Add(1 - value2);
	}
	modelFile >> header;
	int cl, source, destination, value;
	modelFile >> header;
	while(!PeekForHeader(modelFile, "END")) {
		modelFile >> source >> destination >> cl >> value;
		g_forwardDest[g_hierClass][cl][source].Add(value);
	}
	modelFile >> header;
}
void ReadForwards ( ifstream & modelFile ) { int index ; double value1 , value2 ; string header ; modelFile >> header ; while ( ! PeekForHeader ( modelFile , " " ) ) { modelFile >> index >> value1 >> value2 ; g_toForward [ g_hierClass ] [ index ] [ WRITE ] . Add ( value1 ) ; g_toForward [ g_hierClass ] [ index ] [ WRITE ] . Add ( 1 - value1 ) ; g_toForward [ g_hierClass ] [ index ] [ READ ] . Add ( value2 ) ; g_toForward [ g_hierClass ] [ index ] [ READ ] . Add ( 1 - value2 ) ; } modelFile >> header ; int cl , source , destination , value ; modelFile >> header ; while ( ! PeekForHeader ( modelFile , " " ) ) { modelFile >> source >> destination >> cl >> value ; g_forwardDest [ g_hierClass ] [ cl ] [ source ] . Add ( value ) ; } modelFile >> header ; }
Read the forwarding probabilities for node directories.
Read the forwarding probabilities for node directories .
//map<int, map<int, map<int, int> > > iteration;