Skip to content

Commit

Permalink
fixed not calculate the recovery_quantity
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Dong-geun committed Nov 5, 2013
1 parent a123e3f commit c98f348
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion energy.py
Expand Up @@ -194,7 +194,9 @@ def recovered(self, time=None):
passed = self.passed(time)
if passed is None:
return 0
return min(int(passed / self.recovery_interval), self.used)
recover = self.recovery_quantity
recover = int(passed / self.recovery_interval) * recover
return min(recover, self.used)

def passed(self, time=None):
"""Calculates the seconds passed from using the energy first.
Expand Down

0 comments on commit c98f348

Please sign in to comment.