<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package storm.logic;

import storm.interfaces.IRobotLogic;

/**
 *
 * @author Developer
 */
public class Hybrid implements IRobotLogic {

    public void doInit() {
    }

    public void doContinuous() {
    }

    public void doPeriodic() {
    }

    public void doEnd() {
    }
    
}
<commit_msg>Beginning of hybrid<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package storm.logic;

import edu.wpi.first.wpilibj.AnalogChannel;
import storm.RobotState;
import storm.interfaces.IDriveTrain;
import storm.interfaces.IRobotLogic;
import storm.utility.Queue;

/**
 *
 * @author Developer
 */
public class Hybrid implements IRobotLogic {

    IDriveTrain driveTrain;

    AnalogChannel autoType;

    Queue Q = new Queue();

    public Hybrid(int port) {

        driveTrain = RobotState.driveTrain;

        autoType = new AnalogChannel(port);

    }

    public void doInit() {

        //1 - Straight    \\
        //2 - Left        \\
        //3 - Load        \\
        //4 - Shoot       \\
        //5 - Manipulator \\

        switch (autoType.getValue()) {
            case 1: //Super Auto Mode

                //Aim
                //Shoot
                Q.add(1, 60, -.5);
                Q.add(5, 25, 1);
                //Pick up
                //Possibly move
                //Aim
                //Shoot

                break;
            case 2: //Quick ninja

                Q.add(1, 60, -.5);
                Q.add(5, 25, 1);
                //Possibly do a shoot sequence

                break;
            case 3: //Hit and run

                //Aim
                //Shoot

                break;
            case 4: //Flee in terror to the left

                Q.add(2, 50, .8);
                Q.add(1, 50, .5);

                break;
            case 5: //Flee in terror to the right

                Q.add(2, 50, -.8);
                Q.add(1, 50, .5);

                break;
            case 6: //Sitting duck
                break;
            default:
                break;
        }

        Q.start();

    }

    public void doContinuous() {
        //Eat a muffin.  please :)
    }

    public void doPeriodic() {

        if (Q.isRunning()) runQueue();
        if (driveTrain.getDistance() >= Q.getDistance()) Q.next();

    }

    public void doEnd() {
    }

    public void runQueue() {

        switch ((int)Q.getType()) {
            case 1:
                driveTrain.drive(Q.getSpeed(), Q.getSpeed());
                break;
            case 2:
                driveTrain.drive(Q.getSpeed(), -Q.getSpeed());
                break;
            default:
                break;
        }

    }
    
}

{'fraction_non_alphanumeric': 0.1081262592343855, 'fraction_numerical': 0.01511081262592344, 'mean_word_length': 1.091994382022472, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '489980', 'n_tokens_mistral': 984, 'n_tokens_neox': 813, 'n_words': 224}