Exemplo n.º 1
0
        private AddCommandMutation GetMutationForNewInt(ICommandsList commands, NewInt command, int indexToAdd)
        {
            var random = new AddRandom();

            random.TuneNewInt(command.Name, indexToAdd);
            return(new AddCommandMutation(random, commands));
        }
Exemplo n.º 2
0
        private AddCommandMutation GetMutationForStop(ICommandsList commands, int indexToAdd)
        {
            var random = new AddRandom();

            random.TuneStop(indexToAdd);
            return(new AddCommandMutation(random, commands));
        }
Exemplo n.º 3
0
        private AddCommandMutation GetMutationForSetValue(ICommandsList commands, SetValue command, int indexToAdd)
        {
            var random           = new AddRandom();
            var declarationIndex = GetDeclarationIndexOfVariable(command.TargetName, commands);

            random.TuneSetValue(declarationIndex, command.Value, indexToAdd);
            return(new AddCommandMutation(random, commands));
        }
Exemplo n.º 4
0
        private AddCommandMutation GetMutationForConditionBlock(ICommandsList commands, Condition command, int ifIndex, int endIfIndex)
        {
            var random           = new AddRandom();
            var declarationIndex = GetDeclarationIndexOfVariable(command.ConditionName, commands);

            random.TuneConditionBlock(declarationIndex, ifIndex, endIfIndex);
            return(new AddCommandMutation(random, commands));
        }
Exemplo n.º 5
0
        private AddCommandMutation GetMutationForPrint(ICommandsList commands, Print command, int indexToAdd)
        {
            var random           = new AddRandom();
            var declarationIndex = GetDeclarationIndexOfVariable(command.Variable, commands);

            random.TunePrint(declarationIndex, indexToAdd);
            return(new AddCommandMutation(random, commands));
        }
Exemplo n.º 6
0
        private AddCommandMutation GetMutationForGetRandom(ICommandsList commands, GetRandom command, int indexToAdd)
        {
            var random = new AddRandom();
            var targetDeclarationIndex = GetDeclarationIndexOfVariable(command.TargetName, commands);
            var sourceDeclarationIndex = GetDeclarationIndexOfVariable(command.MaxValueName, commands);

            random.TuneGetRandom(targetDeclarationIndex, sourceDeclarationIndex, indexToAdd);
            return(new AddCommandMutation(random, commands));
        }
Exemplo n.º 7
0
        private AddCommandMutation GetMutationForGetState(ICommandsList commands, GetState command, int indexToAdd)
        {
            var random = new AddRandom();
            var targetDeclarationIndex = GetDeclarationIndexOfVariable(command.TargetName, commands);
            var direction = command.Direction;

            random.TuneGetState(targetDeclarationIndex, direction, indexToAdd);
            return(new AddCommandMutation(random, commands));
        }
Exemplo n.º 8
0
        private AddCommandMutation GetMutationForPlus(ICommandsList commands, Plus command, int indexToAdd)
        {
            var random = new AddRandom();
            var targetDeclarationIndex       = GetDeclarationIndexOfVariable(command.TargetName, commands);
            var firstSourceDeclarationIndex  = GetDeclarationIndexOfVariable(command.FirstSource, commands);
            var secondSourceDeclarationIndex = GetDeclarationIndexOfVariable(command.SecondSource, commands);

            random.TunePlus(targetDeclarationIndex, firstSourceDeclarationIndex, secondSourceDeclarationIndex, indexToAdd);
            return(new AddCommandMutation(random, commands));
        }
Exemplo n.º 9
0
 private AddCommandMutation GetMutationForStop(ICommandsList commands, int indexToAdd)
 {
     var random = new AddRandom();
     random.TuneStop(indexToAdd);
     return new AddCommandMutation(random, commands);
 }
Exemplo n.º 10
0
 private AddCommandMutation GetMutationForSetValue(ICommandsList commands, SetValue command, int indexToAdd)
 {
     var random = new AddRandom();
     var declarationIndex = GetDeclarationIndexOfVariable(command.TargetName, commands);
     random.TuneSetValue(declarationIndex, command.Value, indexToAdd);
     return new AddCommandMutation(random, commands);
 }
Exemplo n.º 11
0
 private AddCommandMutation GetMutationForPrint(ICommandsList commands, Print command, int indexToAdd)
 {
     var random = new AddRandom();
     var declarationIndex = GetDeclarationIndexOfVariable(command.Variable, commands);
     random.TunePrint(declarationIndex, indexToAdd);
     return new AddCommandMutation(random, commands);
 }
Exemplo n.º 12
0
 private AddCommandMutation GetMutationForPlus(ICommandsList commands, Plus command, int indexToAdd)
 {
     var random = new AddRandom();
     var targetDeclarationIndex = GetDeclarationIndexOfVariable(command.TargetName, commands);
     var firstSourceDeclarationIndex = GetDeclarationIndexOfVariable(command.FirstSource, commands);
     var secondSourceDeclarationIndex = GetDeclarationIndexOfVariable(command.SecondSource, commands);
     random.TunePlus(targetDeclarationIndex, firstSourceDeclarationIndex, secondSourceDeclarationIndex, indexToAdd);
     return new AddCommandMutation(random, commands);
 }
Exemplo n.º 13
0
 private AddCommandMutation GetMutationForNewInt(ICommandsList commands, NewInt command, int indexToAdd)
 {
     var random = new AddRandom();
     random.TuneNewInt(command.Name, indexToAdd);
     return new AddCommandMutation(random, commands);
 }
Exemplo n.º 14
0
 private AddCommandMutation GetMutationForGetState(ICommandsList commands, GetState command, int indexToAdd)
 {
     var random = new AddRandom();
     var targetDeclarationIndex = GetDeclarationIndexOfVariable(command.TargetName, commands);
     var direction = command.Direction;
     random.TuneGetState(targetDeclarationIndex, direction, indexToAdd);
     return new AddCommandMutation(random, commands);
 }
Exemplo n.º 15
0
 private AddCommandMutation GetMutationForGetRandom(ICommandsList commands, GetRandom command, int indexToAdd)
 {
     var random = new AddRandom();
     var targetDeclarationIndex = GetDeclarationIndexOfVariable(command.TargetName, commands);
     var sourceDeclarationIndex = GetDeclarationIndexOfVariable(command.MaxValueName, commands);
     random.TuneGetRandom(targetDeclarationIndex, sourceDeclarationIndex, indexToAdd);
     return new AddCommandMutation(random, commands);
 }
Exemplo n.º 16
0
 private AddCommandMutation GetMutationForConditionBlock(ICommandsList commands, Condition command, int ifIndex, int endIfIndex)
 {
     var random = new AddRandom();
     var declarationIndex = GetDeclarationIndexOfVariable(command.ConditionName, commands);
     random.TuneConditionBlock(declarationIndex, ifIndex, endIfIndex);
     return new AddCommandMutation(random, commands);
 }