+/EE360P
distributed systems
git clone https://git.julia.blue/+/EE360P
99f4f39
master
1package clocks ; 2public class LamportClock { 3int c ; 4public LamportClock () { 5c =1 ; 6 } 7public int getValue () { 8return c ; 9 } 10public void tick () {// on internal events 11c =c +1 ; 12 } 13public void sendAction () { 14// include c in message 15c =c +1 ; 16 } 17public void receiveAction (int src ,int sentValue ) { 18c =Math .max (c ,sentValue ) +1 ; 19 } 20}