MCPcopy Create free account
hub / github.com/BindsNET/bindsnet / Dot

Class Dot

bindsnet/environment/dot_simulator.py:19–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18
19class Dot:
20 def __init__(self, r: int = 0, c: int = 0, t: int = 1) -> None:
21 # Initialize current point and tail to initial point.
22 self.row = np.ones(t, dtype="int32") * r
23 self.col = np.ones(t, dtype="int32") * c
24
25 def move(self, r: int, c: int):
26 """
27 Cycle path history and set new current coordinates.
28
29 :param r: row
30 :param c: column
31 """
32
33 # Cycle the path history.
34 for t in reversed(range(1, len(self.row))):
35 self.row[t] = self.row[t - 1]
36 self.col[t] = self.col[t - 1]
37
38 # Set new current point
39 self.row[0] = r
40 self.col[0] = c
41
42
43class DotSimulator:

Callers 3

__init__Method · 0.85
stepMethod · 0.85
resetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected