woche12 > master: code py - random walks ergänzt
- stopkriterien - logging
This commit is contained in:
@@ -58,9 +58,23 @@ class Landscape():
|
||||
def coords_middle(self) -> tuple:
|
||||
return tuple(math.floor(s/2) for s in self.shape);
|
||||
|
||||
@property
|
||||
def values(self) -> np.ndarray:
|
||||
return self._fct;
|
||||
|
||||
def fitness(self, *x: int) -> float:
|
||||
return self._fct[x];
|
||||
|
||||
def axis_label(self, i: int, x: int) -> str:
|
||||
if self._one_based:
|
||||
x = x + 1;
|
||||
name = self._labels[i];
|
||||
return f'{name}{x}';
|
||||
|
||||
def axis_labels(self, i: int) -> str:
|
||||
s = self.shape[i];
|
||||
return [ self.axis_label(i, x) for x in range(s) ];
|
||||
|
||||
def label(self, *x: int) -> str:
|
||||
if self._one_based:
|
||||
x = tuple(xx + 1 for xx in x);
|
||||
|
||||
Reference in New Issue
Block a user