Skip to content

Commit

Permalink
Updated the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Jan 7, 2025
1 parent 83b0163 commit e017dab
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions docs/heuristics.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Array
[0] => 0
[1] => 1
[2] => -1
[3] => 0.24
[3] => 0.2419
[4] => 0
[5] => 0
[6] => 0
Expand Down Expand Up @@ -182,7 +182,7 @@ echo $mean;
```

```text
0.08
0.0806
```

### Median
Expand All @@ -196,7 +196,7 @@ echo $median;
```

```text
0.24
0.2419
```

### Mode
Expand All @@ -209,10 +209,6 @@ $mode = EvalArray::mode($f, $board);
echo $mode;
```

```text
NULL
```

In this example, no mode exists since there are no repeating numbers in the evaluation array.

### Standard Deviation
Expand All @@ -226,7 +222,7 @@ echo $sd;
```

```text
0.8243
0.8244
```

## Plot the Oscillations of a Game
Expand All @@ -236,14 +232,14 @@ Given a PGN movetext in SAN format, [Chess\SanPlotter](https://github.com/chessl
```php
use Chess\SanPlotter;
use Chess\Function\CompleteFunction;
use Chess\Variant\Classical\Board;

$f = new CompleteFunction();

$name = 'Space';

$board = new Board();
$movetext = '1.e4 d5 2.exd5 Qxd5';
$name = 'Space';

$time = (new SanPlotter($f, $movetext, $name))->time;
$time = SanPlotter::time($f, $board, $movetext, $name);

print_r($time);
```
Expand Down Expand Up @@ -293,9 +289,9 @@ Array
[0] => 0
[1] => -1
[2] => 1
[3] => -0.24
[4] => -0.07
[5] => -0.02
[3] => -0.2423
[4] => -0.0661
[5] => -0.022
[6] => 0
[7] => 0
[8] => 0
Expand All @@ -304,7 +300,7 @@ Array
[11] => 0
[12] => 0
[13] => 0
[14] => -0.11
[14] => -0.1123
[15] => 0
[16] => 0
[17] => 0
Expand All @@ -319,7 +315,7 @@ Array
[26] => 0
[27] => 0
[28] => 0
[29] => -0.02
[29] => -0.022
[30] => 0
[31] => 0
)
Expand All @@ -338,12 +334,13 @@ print_r($mean);
```

```text
Array
(
[0] => 0
[1] => 0.185
[2] => -0.16
[3] => -0.315
[4] => -0.0657
[1] => 0.1875
[2] => -0.1667
[3] => -0.3125
[4] => -0.0664
)
```

Expand All @@ -361,9 +358,9 @@ print_r($sd);
Array
(
[0] => 0
[1] => 0.7591
[2] => -0.8552
[3] => -0.7274
[1] => 0.7601
[2] => -0.8498
[3] => -0.7294
[4] => -0.5406
)
```
Expand Down
Binary file modified docs/heuristics_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/heuristics_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e017dab

Please sign in to comment.