//List<IPosition> posList; //TimeCounter stopwatch; //Random random; //double[] nnX, nnLogX, m2mnnY, kdtnnY, m2mnnppY, kdtnnppY; /************************************************************************************** * 功能:对算法进行分析 * 参数:width - 地图宽 * height - 地图高 * start - 初始的点集数目 * multiple - 每一轮分析后点集数目的增大倍数 * round - 已不同点集数目分析的次数 * avergae - 对同一点集数目分析的次数(然后取结果平均值) **************************************************************************************/ public void analyse(int askCount) { //生成源点集 askPoint = new KD2DPoint[askCount]; for (int i = 0; i < askCount; i++) { askPoint[i] = getRandomPoint(mapWidth, mapHeight); } m2mNearestPoint = new IPosition[askCount]; kdtNearestPoint = new IPosition[askCount]; double[] dataSequence = SequenceMaker.GenerateData_Multiple(); CurvePlot_Function_Time curvePlot1 = new CurvePlot_Function_Time("Comparsion of the Preprocesses of KDTree and M2M", "PointNumber", "time", false, createPointSet); init(); curvePlot1.addProc("M2MNNPP", runM2MNNPP); curvePlot1.addProc("KDTNNPP", runKDTNNPP); curvePlot1.draw(dataSequence); CurvePlot_Function_Time curvePlot2 = new CurvePlot_Function_Time("Comparsion of the Nearest Neighbor Algorithm base on KDTree and M2M", "PointNumber", "time", false, createPointSetWithPrepare); init(); curvePlot2.addProc("M2MN", runM2MNN); curvePlot2.addProc("KDTNN", runKDTNN); curvePlot2.setAskCount(askCount); curvePlot2.draw(dataSequence); compareResult(); }
//测试画函数图 void test2() { CurvePlot_Function curvePlot = new CurvePlot_Function("hello", "x", "y", false); curvePlot.add("func1", f1); curvePlot.add("func2", f2); curvePlot.draw(SequenceMaker.GenerateData_Linear(0, 10000, 10)); }
//测试计时并作图 void test3() { CurvePlot_Function_Time curvePlot = new CurvePlot_Function_Time("hello", "x", "y", false); curvePlot.addProc("proc1", proc1); curvePlot.addProc("proc2", proc2); //curvePlot.draw(SequenceMaker.genXData_Exp(2, 0, 10)); curvePlot.draw(SequenceMaker.GenerateData_Multiple()); }
public SequenceController(string[] inputArgs) { Parser parser = new Parser(inputArgs); ISequenceMaker maker = new SequenceMaker(parser.InputLimiter); ISequence sequence = new Models.Sequence { Integers = maker.MadeIntegers }; new SequenceViewer(sequence); }
private void btnAnalyse_Click(object sender, EventArgs e) { new ConfiguratedByForm(chc); CurvePlot_Function_Time curvePlot = new CurvePlot_Function_Time("Comparsion Among Convex Hull Algorithm", "Point Number", "time(ms)", false, GetRandomPositionSet); curvePlot.addProc("M2MCH", M2MCH); curvePlot.addProc("M2MPP", M2MPP); curvePlot.addProc("GSCH", GSCH); curvePlot.addProc("QHCH", QHCH); curvePlot.addProc("JMCH", JMCH); //CurvePlot_Function_Time curvePlot = new CurvePlot_Function_Time("Comparsion Among Convex Hull Algorithm", "Point Number", "time(ms)", false, RunPreProcess); //curvePlot.addProc("M2MQCH", M2MQCH); //curvePlot.draw(SequenceMaker.genXData_Exp(2, 0, 10)); //curvePlot.draw(SequenceMaker.GenerateData_Linear(double.Parse(textIncreaseInterval.Text), double.Parse(textMaxPointNum.Text), double.Parse(textIncreaseInterval.Text))); curvePlot.draw(SequenceMaker.GenerateData_Multiple()); }