diff --git a/DecisionSystem/DecentralisedActivityFusion/voter.py b/DecisionSystem/DecentralisedActivityFusion/voter.py index ebf3593..39b00a9 100644 --- a/DecisionSystem/DecentralisedActivityFusion/voter.py +++ b/DecisionSystem/DecentralisedActivityFusion/voter.py @@ -1,3 +1,6 @@ +import paho.mqtt.client as mqtt +import time + class Voter: ''' This class acts to replicate sensor information with the network to come to a consensus @@ -19,8 +22,21 @@ class Voter: on_vote: Callback to get the required vote to broadcast. ''' self.on_vote = on_vote + self.client = mqtt.Client() def submit_vote(self): + # Publish to swarm where all other voters will receive a vote. + + + # Wait a certain amount of time for responses, then fuse the information. + self.fuse_algorithm() + + # Need the error and number of timestamps since voting started to finalise the consensus. + + def fuse_algorithm(self): pass - def \ No newline at end of file + def on_message(self, client, userdata, message): + pass + + \ No newline at end of file