public void nextMapping() { mappingSelected++; if (mappingSelected >= SetUpManager.MappingType.COUNT) { mappingSelected = 0; } mappingText.text = mappingSelected.ToString(); }
public void lastMapping() { mappingSelected--; if (mappingSelected < 0) { mappingSelected = SetUpManager.MappingType.COUNT - 1; } mappingText.text = mappingSelected.ToString(); }
public void SetUp(int _height, int _length, int _transitions, int _stateAmnts, int _historySteps, int[] path, List <int[]> matrix, SetUpManager.MappingType map, float fit) { height = _height; length = _length; transitions = _transitions; stateAmounts = _stateAmnts; historySteps = _historySteps; transitionPath = path; transitionMatrix = matrix; mapping = map; fitness = fit; }
/// <summary> /// Sets up generation parameters /// </summary> /// <param name="height"></param> /// <param name="length"></param> /// <param name="transitions"></param> /// <param name="mapping"></param> /// <param name="historyStep"></param> /// <param name="stateAmount"></param> public void MyStart(int height, int length, int transitions, SetUpManager.MappingType mapping, int historyStep, int stateAmount) { stepHistory = historyStep + 1; currentIndex = new int[stepHistory]; player.GetComponent <SimpleAIController>().SetMapping(mapping); //sets mapping to level testing agen for correct output levelLength = length; levelHeight = height; startPlayerPos = player.transform.position; //Generates empty transition matrix List <int> x = new List <int>(); for (int j = 0; j < transitions; j++) { x.Add(100 / transitions); } //Generates transition index, used to refrence transition state. for (int j = 0; j < transitions; j++) { var idx = Convert.ToString(j, stateAmount); string addon = ""; for (int i = idx.Length - stepHistory; i < 0; i++) { addon += '0'; } transitionIndexString.Add(addon + idx); } probabilityTransList = new List <int[]>(); for (int i = 0; i < transitions; i++) { probabilityTransList.Add(x.ToArray()); } //begins generation 1, using randomly generated transition matrix. NewLevelCandidate(); }
public void SetMapping(SetUpManager.MappingType set) { mapping = set; }