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
ConstructorsConstructorDescriptionMostDirectConnectionSelector(Machine machine, Collection<C> connections) Create a selector. -
Method Summary
Modifier and TypeMethodDescriptiongetNextConnection(SCPRequest<?> request) Get the next connection for the process from a list of connections that might satisfy the request.booleanhasDirectConnectionFor(Chip ethernetChip) Tests if this connection selector will be able to make a direct connection to the given ethernet chip.voidsetMachine(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:ConnectionSelectorGet the next connection for the process from a list of connections that might satisfy the request.- Specified by:
getNextConnectionin 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:
getMachinein interfaceMachineAware- Returns:
- The machine that the class was told about.
-
setMachine
- Specified by:
setMachinein interfaceMachineAware- Parameters:
machine- The machine to tell the class about.
-