Skip to content

Commit

Permalink
Linesight-RL#60 Instance attributes defined outside __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuodan committed Aug 22, 2024
1 parent 576e890 commit e2273c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions trackmania_rl/buffer_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def __init__(
self._average_priority = None
self._default_priority_ratio = default_priority_ratio
self._uninitialized_memories = 0.0
self._sum_tree = None

@property
def default_priority(self) -> float:
Expand Down
2 changes: 2 additions & 0 deletions trackmania_rl/tmi_interaction/game_instance_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def __init__(
self.start_states = {}
self.game_spawning_lock = game_spawning_lock
self.game_activated = False
self.next_real_checkpoint_positions = None
self.max_allowable_distance_to_real_checkpoint = None

def get_tm_window_id(self):
assert self.tm_process_id is not None
Expand Down
2 changes: 1 addition & 1 deletion trackmania_rl/tmi_interaction/tminterface2.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class TMInterface:

def __init__(self, port: int):
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
pass

def close(self):
Expand All @@ -62,7 +63,6 @@ def signal_handler(self, sig, frame):
self.close()

def register(self, timeout=None):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
signal.signal(signal.SIGINT, self.signal_handler)
# https://stackoverflow.com/questions/45864828/msg-waitall-combined-with-so-rcvtimeo
# https://stackoverflow.com/questions/2719017/how-to-set-timeout-on-pythons-socket-recv-method
Expand Down

0 comments on commit e2273c7

Please sign in to comment.