/// <summary> /// This process takes into account the posibility that the evolution algorithm has not been /// started yet. The user is pre-registered, and the save files are moved to the correct folder, /// so that THE new evolution process will automatically read them. /// </summary> private void PrepareAndRaiseBranch(int?id, Candidate candidate, string userName) { ActiveUsersList <NeatGenome> .AddParentToUserName(userName, id); ActiveUsersList <NeatGenome> .SetUserWaitingForAlgorithm(userName); ActiveUsersList <NeatGenome> .SetUserWaitingForVideos(userName); SharpNeat.PopulationReadWrite.MoveSavedFilesToCandidateFolder(candidate.FolderPath, userName); EventsController.RaiseBranchEvent(userName); }
public ActionResult ResetEvolution() { string userName = HttpContext.UserIdentity(); if (CheckIfUserExists(userName)) { WriteLineForDebug("Reset evolution", userName); // The user is active: send a heartbeat HeartBeat(userName); // If we were branching from a saved genome, then the user had that // genome as the parent ID. Reseting evolution means this is no longer // the parent (there is none) so we set this ID to null ActiveUsersList <NeatGenome> .AddParentToUserName(userName, null); ActiveUsersList <NeatGenome> .SetUserWaitingForVideos(userName); EventsController.RaiseResetEvolutionEvent(userName); return(RedirectToAction("WaitingForEvolutionSetup")); } else { return(RedirectToAction("Index")); } }