12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- package de.tu_darmstadt.tk.SmartHomeNetworkSim.core;
- import java.util.Collection;
- /**
- * Physical Link medium for SmartDevices, which connects two or more devices and
- * allows communication between them
- *
- * @author Andreas T. Meyer-Berg
- */
- public interface Link {
- /**
- * @return the name
- */
- public String getName();
- /**
- * @param name
- * the name to set
- */
- public void setName(String name);
- /**
- * @return the devices
- */
- public Collection<SmartDevice> getDevices();
- /**
- * @param device
- * the devices to add
- */
- public void addDevice(SmartDevice device);
- /**
- * @param device
- * the devices to remove
- */
- public void removeDevice(SmartDevice device);
-
- /**
- * @return the connections
- */
- public Collection<Connection> getConnections();
- /**
- * @param connection
- * the connection to add
- */
- public void addConnection(Connection connection);
-
- /**
- * @param connection
- * the connection to remove
- */
- public void removeConnection(Connection connection);
- /**
- * Simulates an interval starting at startTime for a given duration
- *
- * @param startTime
- * Time the simulation interval starts in
- * System.currentTimeMillis() time
- * @param duration
- * Duration of the simulation interval in milliseconds
- */
- public void simulateTimeInterval(long startTime, long duration);
- /**
- * Returns all packets which where sent during the last Simulation time step
- *
- * @return packets, which were sent during the last time step
- */
- public Collection<Packet> getPackets();
-
- /**
- * Returns true if one or more connections have changed, and the Panel might have to be repainted
- * @return true if changed
- */
- public boolean getStatusChanged();
-
- /**
- * Returns the Transmission delay between the two given devices
- * @param from SmartDevice which starts transmission
- * @param to SmartDevices which receives transmission
- * @return delay of the transmission, infinite if to is unreachable or the Packets is lost.
- */
- public long getTransmissionDelayFrom(SmartDevice from, SmartDevice to);
- /**
- * Adds Packets to the internal data structure
- * @param packets Packets, which should be added
- */
- public void addPackets(Collection<Packet> packets);
- }
|