当前位置: 首页>>代码示例>>C++>>正文


C++ Experiment::GetMapName方法代码示例

本文整理汇总了C++中Experiment::GetMapName方法的典型用法代码示例。如果您正苦于以下问题:C++ Experiment::GetMapName方法的具体用法?C++ Experiment::GetMapName怎么用?C++ Experiment::GetMapName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Experiment的用法示例。


在下文中一共展示了Experiment::GetMapName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sizeof

ScenarioConverter::ScenarioConverter( ScenarioLoader *scen )
{
  this->scen = scen;
  ifstream in;
  char scrap[256], type[256];
  int rows, columns, i, j;

  Experiment exp = scen->GetNthExperiment( 0 );
  
  /*cout << "map " << exp.GetMapName() << "\n";*/

  in.open( exp.GetMapName(), ifstream::in );
  in >> scrap; 
  in >> type;
  in >> scrap;
  in >> rows;
  in >> scrap;
  in >> columns;
  in >> scrap;

  /*cout << "type " << type << "\n";
  cout << "rows " << rows << "\n";
  cout << "columns " << columns << "\n";*/

  this->rows = rows;
  this->columns = columns;
  this->map = (char**)malloc( sizeof(char*) * rows );

  for( i = 0; i < rows; i++ )
    this->map[i] = (char*)malloc( sizeof(char) * columns );

  in.get(); /*newline*/
  for( i = 0; i < rows; i++ )
  {
    for( j = 0; j < columns; j++ )
      this->map[i][j] = in.get();
    in.get(); /*newline*/
  }
}
开发者ID:jeffreypicard,项目名称:cs730_final_project,代码行数:39,代码来源:ScenarioConverter.cpp

示例2: main


//.........这里部分代码省略.........

		sprintf(datapath,"outputs/DB%d.dat.bpmxinf",GraphMapInconsistentHeuristic::HN);
		FILE *BPMXidata = fopen(datapath,"a");

		sprintf(datapath,"outputs/DB%d.dat.asd.2",GraphMapInconsistentHeuristic::HN);
		FILE *ASD2data = fopen(datapath,"a");

		sprintf(datapath,"outputs/DB%d.dat.asd.2.bpmx",GraphMapInconsistentHeuristic::HN);
		FILE *ASD2bpmxdata = fopen(datapath,"a");

		sprintf(datapath,"outputs/DB%d.dat.asd.2.bpmxinf",GraphMapInconsistentHeuristic::HN);
		FILE *ASD2bpmxinfdata = fopen(datapath,"a");

		sprintf(datapath,"outputs/DB%d.dat.DP",GraphMapInconsistentHeuristic::HN);
		FILE *DPdata = fopen(datapath,"a");

		sprintf(datapath,"outputs/DB%d.dat.DP.bpmx",GraphMapInconsistentHeuristic::HN);
		FILE *DPbpmxdata = fopen(datapath,"a");

		sprintf(datapath,"outputs/DB%d.dat.DPDL2MX",GraphMapInconsistentHeuristic::HN);
		FILE *DPDL2MXdata = fopen(datapath,"a");

		sprintf(datapath,"outputs/DB%d.dat.NULL",GraphMapInconsistentHeuristic::HN);
		FILE *NULLdata = fopen(datapath,"a");

		for(int iexp=0;iexp<sl->GetNumExperiments();iexp++)
		{
			Experiment exp = sl->GetNthExperiment(iexp);

			char mname[1024];
			//xyLoc locstart, locgoal;
			struct timeval t0,t1;

			exp.GetMapName(mname);

			if((string)(mname)==currentMap && exp.GetXScale()==currentScaleX && exp.GetYScale()==currentScaleY){
				// rebuild the map,g,env only when necessary
			}
			else {
				if(mp != 0) {
					delete mp;
					//delete g;
					//delete heuristic;
					delete env;
				}
				mp = new Map(mname);
				if(exp.GetXScale() <= 0) {
					printf("Invalid scaling\n");
					//exit(-1);
					delete mp;
					continue;
				}
				currentMap = (string)(mname);
				currentScaleX = exp.GetXScale();
				currentScaleY = exp.GetYScale();
				mp->scale(exp.GetXScale(), exp.GetYScale());
				g = GraphSearchConstants::GetGraph(mp);
				heuristic = new GraphMapInconsistentHeuristic(mp, g);
				env = new GraphEnvironment(g,heuristic);  // 
			}


			//mp = new Map(mname);
			//// need to scale the map !
			//if(exp.GetXScale() <= 0) {
			//	printf("Invalid scaling\n");
开发者ID:DavidMChan,项目名称:hog2,代码行数:67,代码来源:benchmarkfull.cpp


注:本文中的Experiment::GetMapName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。