Class AsynchDLPSW86Instance
java.lang.Object
utils.consensus.snapshot.ConsensusState
utils.consensus.asynchConsensusUtilities.AsynchDLPSW86Instance
- All Implemented Interfaces:
ConsensusInstance<Double>
public final class AsynchDLPSW86Instance
extends ConsensusState
implements ConsensusInstance<Double>
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal InstanceID
final MessageLogger
final ConsensusMetrics
final Map<Integer,
CompletableFuture<double[]>> final ReentrantLock
final RequestID
final Double
Fields inherited from class utils.consensus.snapshot.ConsensusState
broadcast, epsilon, groupState, H, n, t
-
Constructor Summary
ConstructorsConstructorDescriptionAsynchDLPSW86Instance
(T other) AsynchDLPSW86Instance
(T snapshot, RequestID reqID, InstanceID instanceID, Double startingV, MessageLogger logger) AsynchDLPSW86Instance
(RequestID reqID, InstanceID instanceID, int n, int t, double epsilon, double startingV, GroupConstitution groupState, Broadcast broadcast) -
Method Summary
Modifier and TypeMethodDescriptionMethod called when a new approximate consensus instance is started by another process.Method called when new approximate consensus instance is started by the calling process.boolean
Check if necessary conditions to guarantee correctness in the execution of the algorithm are still met.void
exchange
(Byte msgType, ApproximationMessage msg, AddressInterface q) Method called as handler of an approximation message.Map<? extends AddressInterface,
? extends ProcessInterface> Getter for the consensus instance's snapshot of the group's constitutionGet the object containing several relevant metrics to profile the execution of this instance of consensusgetReqID()
Getter for the unique identifier of this consensus instance.
-
Field Details
-
multisetPerRound
-
multisetFuturePerRound
-
multisetLock
-
startingV
-
endingV
-
reqID
-
instanceID
-
metrics
-
logger
-
-
Constructor Details
-
AsynchDLPSW86Instance
public AsynchDLPSW86Instance() -
AsynchDLPSW86Instance
public AsynchDLPSW86Instance(RequestID reqID, InstanceID instanceID, int n, int t, double epsilon, double startingV, GroupConstitution groupState, Broadcast broadcast) -
AsynchDLPSW86Instance
public AsynchDLPSW86Instance(T snapshot, RequestID reqID, InstanceID instanceID, Double startingV, MessageLogger logger) -
AsynchDLPSW86Instance
public AsynchDLPSW86Instance(T other)
-
-
Method Details
-
approximateConsensus_other
Description copied from interface:ConsensusInstance
Method called when a new approximate consensus instance is started by another process.- Specified by:
approximateConsensus_other
in interfaceConsensusInstance<Double>
- Parameters:
msg
- The first message to be processed.- Returns:
- Completable Future containing the result of this instance of consensus
-
approximateConsensus_self
Description copied from interface:ConsensusInstance
Method called when new approximate consensus instance is started by the calling process.- Specified by:
approximateConsensus_self
in interfaceConsensusInstance<Double>
- Returns:
- Completable Future containing the result of this instance of consensus
-
exchange
Description copied from interface:ConsensusInstance
Method called as handler of an approximation message. Consumes the message, which may advance the state of the consensus instance.- Specified by:
exchange
in interfaceConsensusInstance<Double>
- Parameters:
msgType
- Type of message (initialization, approximation, etc.)msg
- Object containing the payload of the messageq
- Address of the message's sender
-
consensusStillPossible
public boolean consensusStillPossible()Description copied from interface:ConsensusInstance
Check if necessary conditions to guarantee correctness in the execution of the algorithm are still met.- Specified by:
consensusStillPossible
in interfaceConsensusInstance<Double>
- Returns:
- True if conditions are met, false, otherwise.
-
getGroupState
Description copied from interface:ConsensusInstance
Getter for the consensus instance's snapshot of the group's constitution- Specified by:
getGroupState
in interfaceConsensusInstance<Double>
- Returns:
- Group Constitution as a mapping of group members to their respective address.
-
getReqID
Description copied from interface:ConsensusInstance
Getter for the unique identifier of this consensus instance.- Specified by:
getReqID
in interfaceConsensusInstance<Double>
- Returns:
- Unique identifier of the consensus instance.
-
getMetrics
Description copied from interface:ConsensusInstance
Get the object containing several relevant metrics to profile the execution of this instance of consensus- Specified by:
getMetrics
in interfaceConsensusInstance<Double>
- Returns:
- Object storing metrics relative to an execution of an approximate consensus algorithm.
-