Cluster.cpp
// write results to files with certain formats
write results to files with certain formats
write results to files with certain formats
void outputClusters(std::vector<Cluster> v, string team)
{
	for (std::vector<Cluster>::iterator i = v.begin(); i != v.end(); ++i)
	{
		int index = i - v.begin();
		string filepath = "Cluster\\" + team + "Cluster" + to_string(index) + ".txt";
		ofstream file(filepath);
		for (vector<Phase>::iterator j = i->phases.begin(); j != i->phases.end(); ++j){
			file << '[' ;
			for (std::vector<Event>::iterator ie = (*j).begin(); ie < (*j).end() - 1; ++ie)
			{
				file << ie->event_type << ",";
			}
			file << ((*j).end() - 1)->event_type;
			file << "]" << endl;
		}
		file.close();
	}
}
void outputClusters ( std :: vector < Cluster > v , string team ) { for ( std :: vector < Cluster > :: iterator i = v . begin ( ) ; i != v . end ( ) ; ++ i ) { int index = i - v . begin ( ) ; string filepath = " \\ " + team + " " + to_string ( index ) + " " ; ofstream file ( filepath ) ; for ( vector < Phase > :: iterator j = i -> phases . begin ( ) ; j != i -> phases . end ( ) ; ++ j ) { file << ' ' ; for ( std :: vector < Event > :: iterator ie = ( * j ) . begin ( ) ; ie < ( * j ) . end ( ) - 1 ; ++ ie ) { file << ie -> event_type << " " ; } file << ( ( * j ) . end ( ) - 1 ) -> event_type ; file << " " << endl ; } file . close ( ) ; } }
write results to files with certain formats
write results to files with certain formats