Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low end feature #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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