Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace global clock with Lamport timestamps #10

Open
lou1306 opened this issue Sep 28, 2018 · 0 comments
Open

Replace global clock with Lamport timestamps #10

lou1306 opened this issue Sep 28, 2018 · 0 comments

Comments

@lou1306
Copy link
Collaborator

lou1306 commented Sep 28, 2018

  1. In the header, replace int __LABS_t with an array unsigned int clock[MAXCOMPONENTS]. Change the now() function so that it takes the agent's id as an argument.
  2. Inside init(), increase clock[0] when initializing stigmergic variables. At the end, set all elements of clock to the value of clock[0].
  3. Change confirm and propagate with a tie-breaking rule.

Feasible tie-breaking rules

Agent with lowest id "wins"

✅ original solution from Lamport,
✅ also the one used in Buzz
❌ requires to keep track of the id with another array Lid[MAXCOMPONENTS][MAXKEYL]

Smaller or equal Lvalue wins

✅ No changes to the data structures
❌ Requires some theoretical justification (eg. will the stigmergy be stable?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant