<commit_before>﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

interface CarControllerInt {
	// <summary>
	// Returns a Tuple pair of (speed, turn), where speed ranges from 0 (no speed) to 
	// 1 (max speed), and turn ranges from -1 (represents full left turn) to 1 (represents
	// full right turn)
	// </summary>
	// <param name="car"> 
	// Gameobject representing a car
	// </param>
	Tuple<float, float> speedAndTurn(GameObject car);
}

public class CarController : CarControllerInt {
	private float oldDistance = 100000f;
	private bool justSwitchedWaypoint = false;

	public Tuple<float, float> speedAndTurn(GameObject car) {
		//Adjust steer accordingly if obstacles are present
		ObstacleAvoid obstacleAvoid = car.GetComponent<ObstacleAvoid> ();
		float speed = 0; 
		float steer = 0;
		if (obstacleAvoid.leftObs && !obstacleAvoid.rightObs)
			steer = Mathf.Max (1.2f/obstacleAvoid.LeftDis, 0.35f);
		if (obstacleAvoid.rightObs && !obstacleAvoid.leftObs) 
			steer = -1 * Mathf.Max (1.2f/obstacleAvoid.RightDis, 0.35f);
		if (obstacleAvoid.centerObs && !obstacleAvoid.rightObs && !obstacleAvoid.leftObs) {
			steer = Mathf.Max (1.2f/obstacleAvoid.CenterDis, 0.35f); 
		}<commit_msg>Remove unused variable from simulation<commit_after>﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

interface CarControllerInt {
	// <summary>
	// Returns a Tuple pair of (speed, turn), where speed ranges from 0 (no speed) to 
	// 1 (max speed), and turn ranges from -1 (represents full left turn) to 1 (represents
	// full right turn)
	// </summary>
	// <param name="car"> 
	// Gameobject representing a car
	// </param>
	Tuple<float, float> speedAndTurn(GameObject car);
}

public class CarController : CarControllerInt {
	private bool justSwitchedWaypoint = false;

	public Tuple<float, float> speedAndTurn(GameObject car) {
		//Adjust steer accordingly if obstacles are present
		ObstacleAvoid obstacleAvoid = car.GetComponent<ObstacleAvoid> ();
		float speed = 0; 
		float steer = 0;
		if (obstacleAvoid.leftObs && !obstacleAvoid.rightObs)
			steer = Mathf.Max (1.2f/obstacleAvoid.LeftDis, 0.35f);
		if (obstacleAvoid.rightObs && !obstacleAvoid.leftObs) 
			steer = -1 * Mathf.Max (1.2f/obstacleAvoid.RightDis, 0.35f);
		if (obstacleAvoid.centerObs && !obstacleAvoid.rightObs && !obstacleAvoid.leftObs) {
			steer = Mathf.Max (1.2f/obstacleAvoid.CenterDis, 0.35f); 
		}
{'fraction_non_alphanumeric': 0.11866501854140915, 'fraction_numerical': 0.020601565718994644, 'mean_word_length': 4.266811279826464, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3857243', 'n_tokens_mistral': 917, 'n_tokens_neox': 827, 'n_words': 220}