1
0
mirror of https://github.com/gsi-upm/soil synced 2025-08-24 03:52:20 +00:00

Fix conditionals

This commit is contained in:
J. Fernando Sánchez
2022-10-17 19:29:39 +02:00
parent 5d759d0072
commit 227fdf050e
15 changed files with 320 additions and 231 deletions

View File

@@ -64,6 +64,7 @@ class Patron(FSM, NetworkAgent):
drunk = False
pints = 0
max_pints = 3
kicked_out = False
@default_state
@state
@@ -105,7 +106,9 @@ class Patron(FSM, NetworkAgent):
'''I'm out. Take me home!'''
self.info('I\'m so drunk. Take me home!')
self['drunk'] = True
pass # out drunk
if self.kicked_out:
return self.at_home
pass # out drun
@state
def at_home(self):
@@ -118,7 +121,7 @@ class Patron(FSM, NetworkAgent):
self.debug('Cheers to that')
def kick_out(self):
self.set_state(self.at_home)
self.kicked_out = True
def befriend(self, other_agent, force=False):
'''