Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
daviidsilvaa committed Aug 11, 2017
1 parent 2a57711 commit a0a8ecd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions lua/Dam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ Dam = Model{
execute = function(self) -- each time step
local outFlow = self.population * self.consumePerPerson * self.kWh2cubicMeters -- update outflow
self.water = self.water - outFlow -- update water
--local abc = 5
if self.water <= 0 then -- water amount less than zero
self.water = 0
--print(self.timer:getTime())
elseif self.water > 5e9 then -- water amount more than dam capacity
self.water = 5e9
end
Expand All @@ -47,7 +45,6 @@ Dam = Model{
target = self,
select = "water"
}

self.timer = Timer{
Event{action = self, priority = 'high'},
Event{period = 12, action = function()
Expand Down
2 changes: 1 addition & 1 deletion lua/Dam.lua~
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Dam = Model{
--local abc = 5
if self.water <= 0 then -- water amount less than zero
self.water = 0
print(self.timer:getTime())
--print(self.timer:getTime())
elseif self.water > 5e9 then -- water amount more than dam capacity
self.water = 5e9
end
Expand Down

0 comments on commit a0a8ecd

Please sign in to comment.