<commit_before>package behaviour;

import agents.Taxi;
import city.DropoffPoint;
import jade.core.behaviours.Behaviour;
import jade.core.behaviours.CyclicBehaviour;
import utils.agentMethods.TaxiMethods;
import utils.misc.Activity;
import utils.shortestPath.DijkstraUndirectedSP;
import utils.shortestPath.Edge;
import utils.shortestPath.Path;
import utils.simulation.Timer;

/**
 * Created by jherez on 6/12/16.
 */
public class LocationBehaviour extends CyclicBehaviour {
    public Taxi agent;
    public DropoffPoint origin;
    public DropoffPoint destination;
    public Path path = new Path();
    DijkstraUndirectedSP sp;
    public Timer timer;
    public double jobTime;
    public int initTime;

    public LocationBehaviour(DropoffPoint origin, DropoffPoint destination, Taxi taxi, Timer runtime) {
        this.timer = runtime;
        this.initTime = runtime.getSecond();
        this.agent = taxi;
        this.origin = origin;
        this.destination = destination;
        sp = this.agent.vCity.getShortestPaths(this.agent.vCity.G, origin.index);
        this.path.w = origin.index;
        this.path.v = destination.index;
        this.path.weight = sp.distTo(destination.index);
        for (Edge e : sp.pathTo(destination.index)) {
            this.path.list.add(e);
        }
        this.agent.activity = Activity.TRANSPORTING_PASSENGER;<commit_msg>Oneshot behaviour<commit_after>package behaviour;

import agents.Taxi;
import city.DropoffPoint;
import jade.core.behaviours.Behaviour;
import jade.core.behaviours.CyclicBehaviour;
import jade.core.behaviours.OneShotBehaviour;
import utils.agentMethods.TaxiMethods;
import utils.misc.Activity;
import utils.shortestPath.DijkstraUndirectedSP;
import utils.shortestPath.Edge;
import utils.shortestPath.Path;
import utils.simulation.Timer;

/**
 * Created by jherez on 6/12/16.
 */
public class LocationBehaviour extends OneShotBehaviour {
    public Taxi agent;
    public DropoffPoint origin;
    public DropoffPoint destination;
    public Path path = new Path();
    DijkstraUndirectedSP sp;
    public Timer timer;
    public double jobTime;
    public int initTime;

    public LocationBehaviour(DropoffPoint origin, DropoffPoint destination, Taxi taxi, Timer runtime) {
        this.timer = runtime;
        this.initTime = runtime.getSecond();
        this.agent = taxi;
        this.origin = origin;
        this.destination = destination;
        sp = this.agent.vCity.getShortestPaths(this.agent.vCity.G, origin.index);
        this.path.w = origin.index;
        this.path.v = destination.index;
        this.path.weight = sp.distTo(destination.index);
        for (Edge e : sp.pathTo(destination.index)) {
            this.path.list.add(e);
        }
        this.agent.activity = Activity.TRANSPORTING_PASSENGER;
{'fraction_non_alphanumeric': 0.09373881932021468, 'fraction_numerical': 0.0035778175313059034, 'mean_word_length': 3.389324960753532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '245592', 'n_tokens_mistral': 864, 'n_tokens_neox': 843, 'n_words': 186}