package projects.defaultProject.models.messageTransmissionModels;

import sinalgo.nodes.Node;
import sinalgo.nodes.messages.Message;
import projects.defaultProject.nodes.messages.Container; 

public class Packet  {
	private Node s, d;
	private Message m;
	private Double t;
	
	Packet(Node s, Node d, Message m, Double t){
		this.s=s;
		this.d=d;
		this.m=m;
		this.t=t;
	}
	
	public Message getMessage() {
		return ((Container) m).m;
	}
	
	public Node getSender() {
		return s;
	}

	public Node getReceiver() {
		return d;
	}
	
	public double getTime() {
		return t;
	}
	
	public Packet clone() {
		return new Packet(s,d,m,t);
	}
	
	public boolean InLink(Node s, Node d) {
		return this.s.ID==s.ID && this.d.ID==d.ID;
	}


}
