<commit_before>using UnityEngine;
using System.Collections;
using SanityEngine.Actors;
using SanityEngine.Movement.SteeringBehaviors;
using SanityEngine.Movement.PathFollowing;
using SanityEngine.Structure.Graph;
using SanityEngine.Structure.Path;
using SanityEngine.Search.PathFinding;
using SanityEngine.Search.PathFinding.Algorithms;
using SanityEngine.Utility.Heuristics;

[AddComponentMenu("Sanity Engine/Movement/Path Follower")]
public class PathFollowerComponent : SteeringBehaviorComponent {
	public UnityGraph graph;
	public DecisionMaker decisionMaker;

	PointActor target;
	Arrive arrive;
	ASearch<UnityNode, UnityEdge> finder;
	Path<UnityNode, UnityEdge> path;
	CoherentPathFollower<UnityNode, UnityEdge> follower;
	UnityNode lastGoal;

	void Awake () {
		Heuristic heuristic = new EuclideanHeuristic();
		
		finder = new ASearch<UnityNode, UnityEdge>(heuristic.Heuristic);
		follower = new CoherentPathFollower<UnityNode, UnityEdge>();
		arrive = new Arrive();
		arrive.TimeToTarget = 3;
		arrive.ArriveRadius = 1.0f;
		target = new PointActor(Vector3.zero);
		arrive.Target = target;
	}
	
	// Update is called once per frame
	void Update () {
		UnityNode goal = decisionMaker.GetMovementTarget();
		if(goal == null) {
			arrive.Weight = 0f;
			return;
		}
		if(!follower.Valid || goal != lastGoal) {
			arrive.Weight = 0f;
			path = finder.Search(graph.Quantize(transform.position), goal);
			follower.Path = path;
			lastGoal = goal;
			return;<commit_msg>Changed the path following arrive radius<commit_after>using UnityEngine;
using System.Collections;
using SanityEngine.Actors;
using SanityEngine.Movement.SteeringBehaviors;
using SanityEngine.Movement.PathFollowing;
using SanityEngine.Structure.Graph;
using SanityEngine.Structure.Path;
using SanityEngine.Search.PathFinding;
using SanityEngine.Search.PathFinding.Algorithms;
using SanityEngine.Utility.Heuristics;

[AddComponentMenu("Sanity Engine/Movement/Path Follower")]
public class PathFollowerComponent : SteeringBehaviorComponent {
	public UnityGraph graph;
	public DecisionMaker decisionMaker;

	PointActor target;
	Arrive arrive;
	ASearch<UnityNode, UnityEdge> finder;
	Path<UnityNode, UnityEdge> path;
	CoherentPathFollower<UnityNode, UnityEdge> follower;
	UnityNode lastGoal;

	void Awake () {
		Heuristic heuristic = new EuclideanHeuristic();
		
		finder = new ASearch<UnityNode, UnityEdge>(heuristic.Heuristic);
		follower = new CoherentPathFollower<UnityNode, UnityEdge>();
		arrive = new Arrive();
		arrive.TimeToTarget = 3;
		arrive.ArriveRadius = 5.0f;
		target = new PointActor(Vector3.zero);
		arrive.Target = target;
	}
	
	// Update is called once per frame
	void Update () {
		UnityNode goal = decisionMaker.GetMovementTarget();
		if(goal == null) {
			arrive.Weight = 0f;
			return;
		}
		if(!follower.Valid || goal != lastGoal) {
			arrive.Weight = 0f;
			path = finder.Search(graph.Quantize(transform.position), goal);
			follower.Path = path;
			lastGoal = goal;
			return;
{'fraction_non_alphanumeric': 0.09895658027600135, 'fraction_numerical': 0.004039044092898014, 'mean_word_length': 5.377682403433476, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3620928', 'n_tokens_mistral': 1052, 'n_tokens_neox': 920, 'n_words': 210}