Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions UnityNEAT/Assets/SharpNEAT/Core/UnityParallelListEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private IEnumerator evaluateList(IList<TGenome> genomeList)
Utility.Log("Iteration " + (i + 1));
_phenomeEvaluator.Reset();
dict = new Dictionary<TGenome, TPhenome>();
int curr_group_size = _optimizer.Group_Size;
foreach (TGenome genome in genomeList)
{

Expand All @@ -80,8 +81,12 @@ private IEnumerator evaluateList(IList<TGenome> genomeList)
// fitnessDict.Add(phenome, new FitnessInfo[_optimizer.Trials]);
//}
Coroutiner.StartCoroutine(_phenomeEvaluator.Evaluate(phenome));


curr_group_size++;
if(_optimizer.Group_Eval){
if(curr_group_size%_optimizer.Group_Size == 0){
yield return new WaitForSeconds(_optimizer.TrialDuration);
}
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions UnityNEAT/Assets/SharpNEAT/Optimizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class Optimizer : MonoBehaviour {
public int Trials;
public float TrialDuration;
public float StoppingFitness;
public bool Group_Eval = false;
public int Group_Size = 0;
bool EARunning;
string popFileSavePath, champFileSavePath;

Expand Down