package agent.behaviours;

import jade.core.Agent;
import jade.core.behaviours.TickerBehaviour;
import agent.ExpertAgent;
import android.util.Log;

import communication.ExpertMessage;
import communication.MessageType;

public class SendExpertLocationPeriodicallyBehaviour extends TickerBehaviour {

	public SendExpertLocationPeriodicallyBehaviour(Agent a, long period) {
		super(a, period);
		// TODO Auto-generated constructor stub
	}

	@Override
	protected void onTick() {
		
		ExpertAgent agent = (ExpertAgent) getAgent();
		ExpertMessage msg = new ExpertMessage(agent.getAID(), agent.getExpertData());
		msg.setType(MessageType.LOCATION);
		
		agent.sendMessage(msg);
		
		Log.i("expertAgent", "Tick");
	}

}
