我想在循环外的某个点处破解代码,并希望从嵌套循环内的点或线继续它。我尝试了“goto”选项,但它给了我语法错误。
if (PopulationID == 1)
{
AlPopulation = ClsChm.ProduceInitialChrPopulation(PopulationID);
}
else
{
///break at this point
goto end;
}
try
{
for (GenerationIndex = PopulationID ; GenerationIndex <= NumberOfGenerations; GenerationIndex++) //Start of Generation Loop
{
PopulationID = GenerationIndex;
AlFitness.Clear();
for (ChromosomeID = 0; ChromosomeID <= (NumberOfOffsprings ); ChromosomeID++) // Start of Chromosome Loop
{
Fitness = 0;
Altemp = (int[])AlPopulation[ChromosomeID];
for (NumOfSample = 0; NumOfSample < 100 ; NumOfSample++ ) // start of Sample loop
{
///continue at this point
end:
}
}
}
}
...