Skip to content

Commit

Permalink
Working 100%ish
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtch committed Dec 19, 2016
1 parent a1daf8e commit 589791f
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ def step(self):
and self.requestList.next().isReady(self.time) \
and len(responsePackets) <= MAX_PACKETS_PER_STEP:
headPacket = self.requestList.pop()
if headPacket.arriveTime() < self.time:
headPacket.addLatency(self.time - headPacket.arriveTime())
for i in xrange(1, self.num_players + 1):
newPacket = headPacket.deepcopy()
newPacket.sender = 0
Expand Down
4 changes: 3 additions & 1 deletion packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def arriveTime(self):
return self.timestamp + self.elapsedTime

def deepcopy(self):
return Packet(self.timestamp, self.receiver, self.sender, self.packet_id)
p = Packet(self.timestamp, self.receiver, self.sender, self.packet_id)
p.addLatency(self.elapsedTime)
return p

# Packet priority queue, with packets ordered by arrival time
class PacketQueue(object):
Expand Down
Binary file modified results/test1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/test2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/test3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/test4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/test5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 589791f

Please sign in to comment.