Skip to content

Commit

Permalink
Deleted the unnormalized signal
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Dec 23, 2024
1 parent 2661d64 commit cf2a549
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
8 changes: 0 additions & 8 deletions src/SanSignal.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ class SanSignal extends SanPlay
{
use SanTrait;

/**
* Unnormalized signal.
*
* @var array
*/
public array $unnormalized = [];

/**
* The normalized signal in the time domain.
*
Expand Down Expand Up @@ -95,7 +88,6 @@ public function __construct(
}

for ($i = 0; $i < count($this->timeComponent[0]); $i++) {
$this->unnormalized[$i] = round(array_sum(array_column($this->timeComponent, $i)), 2);
$this->time[$i] = round(array_sum(array_column($this->balance, $i)), 2);
}
}
Expand Down
40 changes: 0 additions & 40 deletions tests/unit/SanSignalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function e4_d5_exd5_Qxd5()
$expectedCenter = [ 0, 1.0, 0.09, 0.65, -1.0 ];
$expectedConnectivity = [ 0.0, -1.0, -1.0, -1.0, 1.0 ];
$expectedSpace = [ 0.0, 1.0, 0.25, 0.50, -1.0 ];
$expectedUnnormalized = [ 0.0, 20.4, 1.1, 10.0, -64.1 ];
$expectedTime = [ 0.0, 2.0, -1.66, -0.18, -5.0 ];
$expectedFreq = [ 0.0, 0.73, -0.45, -2.24, -0.46 ];

Expand All @@ -36,7 +35,6 @@ public function e4_d5_exd5_Qxd5()
$this->assertEquals($expectedCenter, $sanSignal->balance[1]);
$this->assertEquals($expectedConnectivity, $sanSignal->balance[2]);
$this->assertEquals($expectedSpace, $sanSignal->balance[3]);
$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
$this->assertEquals($expectedFreq, $sanSignal->freq);
}
Expand All @@ -46,13 +44,11 @@ public function e4_d5_exd5_Qxd5()
*/
public function A59()
{
$expectedUnnormalized = [ 0.0, 18.4, 2.7, 11.7, 4.7, 5.7, 1.7, 6.7, 4.7, 2.7, -7.3, 3.2, -1.9, 7.4, -4.37, 13.17, 9.07, 10.17 ];
$expectedTime = [ 0.0, 2.5, 0.78, 1.0, 1.32, 1.4, 1.7, 3.53, 3.04, 2.78, 0.0, 1.86, 0.19, 0.89, -2.17, 3.41, 2.05, 2.23 ];

$A59 = file_get_contents(self::DATA_FOLDER.'/sample/A59.pgn');
$sanSignal = new SanSignal(self::$function, $A59, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -61,13 +57,11 @@ public function A59()
*/
public function a3()
{
$expectedUnnormalized = [ 0.0, 2.0 ];
$expectedTime = [ 0.0, 2.0 ];

$movetext = '1.a3';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -76,13 +70,11 @@ public function a3()
*/
public function a4()
{
$expectedUnnormalized = [ 0.0, 3.0 ];
$expectedTime = [ 0.0, 2.0 ];

$movetext = '1.a4';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -91,13 +83,11 @@ public function a4()
*/
public function b4()
{
$expectedUnnormalized = [ 0.0, 5.0 ];
$expectedTime = [ 0.0, 1.0 ];

$movetext = '1.b4';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -106,13 +96,11 @@ public function b4()
*/
public function c4()
{
$expectedUnnormalized = [ 0.0, 9.0 ];
$expectedTime = [ 0.0, 1.0 ];

$movetext = '1.c4';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -121,13 +109,11 @@ public function c4()
*/
public function d4()
{
$expectedUnnormalized = [ 0.0, 18.4 ];
$expectedTime = [ 0.0, 3.0 ];

$movetext = '1.d4';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -136,13 +122,11 @@ public function d4()
*/
public function e4()
{
$expectedUnnormalized = [ 0.0, 20.4 ];
$expectedTime = [ 0.0, 2.0 ];

$movetext = '1.e4';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -151,13 +135,11 @@ public function e4()
*/
public function f4()
{
$expectedUnnormalized = [ 0.0, 9.3 ];
$expectedTime = [ 0.0, 2.0 ];

$movetext = '1.f4';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -166,13 +148,11 @@ public function f4()
*/
public function g4()
{
$expectedUnnormalized = [ 0.0, 5.3 ];
$expectedTime = [ 0.0, 1.0 ];

$movetext = '1.g4';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -181,13 +161,11 @@ public function g4()
*/
public function h4()
{
$expectedUnnormalized = [ 0.0, 3.2 ];
$expectedTime = [ 0.0, 2.0 ];

$movetext = '1.h4';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -196,13 +174,11 @@ public function h4()
*/
public function a4_h5()
{
$expectedUnnormalized = [ 0.0, 3.0, -0.2 ];
$expectedTime = [ 0.0, 2.0, -1.0 ];

$movetext = '1.a4 h5';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -211,13 +187,11 @@ public function a4_h5()
*/
public function a4_a5()
{
$expectedUnnormalized = [ 0.0, 3.0, 0.0 ];
$expectedTime = [ 0.0, 2.0, 0.0 ];

$movetext = '1.a4 a5';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -226,13 +200,11 @@ public function a4_a5()
*/
public function a4_e5()
{
$expectedUnnormalized = [ 0.0, 3.0, -17.4 ];
$expectedTime = [ 0.0, 2.0, -2.0 ];

$movetext = '1.a4 e5';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -241,13 +213,11 @@ public function a4_e5()
*/
public function h4_e5()
{
$expectedUnnormalized = [ 0.0, 3.2, -17.1 ];
$expectedTime = [ 0.0, 2.0, -3.0 ];

$movetext = '1.h4 e5';
$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -256,15 +226,13 @@ public function h4_e5()
*/
public function a5()
{
$expectedUnnormalized = [ 0.0, 4.0 ];
$expectedTime = [ 0.0, 4.0 ];

$fen = '7k/8/8/8/P7/8/8/7K w - -';
$movetext = '1.a5';
$board = FenToBoardFactory::create($fen);
$sanSignal = new SanSignal(self::$function, $movetext, $board);

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -273,15 +241,13 @@ public function a5()
*/
public function a6()
{
$expectedUnnormalized = [ 0.0, 5.0 ];
$expectedTime = [ 0.0, 5.0 ];

$fen = '7k/8/8/P7/8/8/8/7K w - -';
$movetext = '1.a6';
$board = FenToBoardFactory::create($fen);
$sanSignal = new SanSignal(self::$function, $movetext, $board);

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -290,15 +256,13 @@ public function a6()
*/
public function a7()
{
$expectedUnnormalized = [ 0.0, 3.0 ];
$expectedTime = [ 0.0, 3.0 ];

$fen = '4k3/8/P7/8/8/8/8/4K3 w - -';
$movetext = '1.a7';
$board = FenToBoardFactory::create($fen);
$sanSignal = new SanSignal(self::$function, $movetext, $board);

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -307,15 +271,13 @@ public function a7()
*/
public function b5()
{
$expectedUnnormalized = [ 0.0, 8.0 ];
$expectedTime = [ 0.0, 4.0 ];

$fen = '7k/8/8/8/1P6/8/8/7K w - -';
$movetext = '1.b5';
$board = FenToBoardFactory::create($fen);
$sanSignal = new SanSignal(self::$function, $movetext, $board);

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}

Expand All @@ -324,15 +286,13 @@ public function b5()
*/
public function h7()
{
$expectedUnnormalized = [ 0.0, 3.2 ];
$expectedTime = [ 0.0, 4.0 ];

$fen = '4k3/8/7P/8/8/8/8/4K3 w - -';
$movetext = '1.h7';
$board = FenToBoardFactory::create($fen);
$sanSignal = new SanSignal(self::$function, $movetext, $board);

$this->assertEquals($expectedUnnormalized, $sanSignal->unnormalized);
$this->assertEquals($expectedTime, $sanSignal->time);
}
}

0 comments on commit cf2a549

Please sign in to comment.