package simulator;

import utils.*;
import java.util.*;

public interface CommunicationsModel {
  // this symbol should be returned when receive detects a conflict
  public static final Symbol CONFLICT = Symbol.GetSymbol("conflict");

  // gives the comm model its underlying network to discover about
  // communications from. The physical network may be assumed to be 
  // stable following this call
  public void setNetwork(EmbeddedNetwork net);
  // take a sending event and turn it into receives
  // this may include adding delays and changing data
  public Collection broadcast(SimulatorEvent e);
  // same as broadcast, but point-to-point [requires t is a neighbor]
  public SimulatorEvent pointtopoint(SimulatorEvent e, Processor t);
  // determine if data actually made it across the gap
  public Object receive(SimulatorEvent e);
  // determine whether there's a carrier at this location & time
  // not required to be true: this is supposed to be a helpful indicator
  public boolean carrierSense(double time, double x, double y);
}
