Class MostDirectConnectionSelector<C extends SCPSenderReceiver>
java.lang.Object
uk.ac.manchester.spinnaker.connections.MostDirectConnectionSelector<C>
- Type Parameters:
C
- The type of connections selected between.
- All Implemented Interfaces:
ConnectionSelector<C>
,MachineAware
public final class MostDirectConnectionSelector<C extends SCPSenderReceiver> extends Object implements ConnectionSelector<C>, MachineAware
A selector that goes for the most direct connection for the message.
-
Constructor Summary
Constructors Constructor Description MostDirectConnectionSelector(Machine machine, Collection<C> connections)
Create a selector. -
Method Summary
Modifier and Type Method Description Machine
getMachine()
C
getNextConnection(SCPRequest<?> request)
Get the next connection for the process from a list of connections that might satisfy the request.boolean
hasDirectConnectionFor(Chip ethernetChip)
Tests if this connection selector will be able to make a direct connection to the given ethernet chip.void
setMachine(Machine machine)
-
Constructor Details
-
MostDirectConnectionSelector
Create a selector.- Parameters:
machine
- The machine, used to work out efficient routing strategies.connections
- The connections that can be chosen between.
-
-
Method Details
-
getNextConnection
Description copied from interface:ConnectionSelector
Get the next connection for the process from a list of connections that might satisfy the request.- Specified by:
getNextConnection
in interfaceConnectionSelector<C extends SCPSenderReceiver>
- Parameters:
request
- The SCP message to be sent- Returns:
- The connection on which the message should be sent.
-
hasDirectConnectionFor
Tests if this connection selector will be able to make a direct connection to the given ethernet chip.- Parameters:
ethernetChip
- The ethernet chip that we are testing for direct routing to.- Returns:
- True iff we can talk directly to it using a connection that this selector knows about.
-
getMachine
- Specified by:
getMachine
in interfaceMachineAware
- Returns:
- The machine that the class was told about.
-
setMachine
- Specified by:
setMachine
in interfaceMachineAware
- Parameters:
machine
- The machine to tell the class about.
-