diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/AccordanceCalculators/MutualComplianceDegreeTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/AccordanceCalculators/MutualComplianceDegreeTests.cs index 80a90f90..6df29305 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/AccordanceCalculators/MutualComplianceDegreeTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/AccordanceCalculators/MutualComplianceDegreeTests.cs @@ -30,8 +30,8 @@ public class MutualComplianceDegreeTests : AccordanceCalculatorsTests [TestCase(2, Link.Both, 9.2345665)] [TestCase(2, Link.Cycle, 7.5384077985)] + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] + [TestCase(4, Link.Cycle, 0)] + [TestCase(30, Link.Start, 3.5849625)] public void ChainCalculationTest(int index, Link link, double value) { diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/ArithmeticMeanTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/ArithmeticMeanTests.cs index fa7eefef..b74c5859 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/ArithmeticMeanTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/ArithmeticMeanTests.cs @@ -33,6 +33,12 @@ public class ArithmeticMeanTests : FullCalculatorsTests [TestCase(2, Link.Both, 3.142857142857)] [TestCase(2, Link.Cycle, 4)] + [TestCase(4, Link.None, 1)] + [TestCase(4, Link.Start, 1)] + [TestCase(4, Link.End, 1)] + [TestCase(4, Link.Both, 1)] + [TestCase(4, Link.Cycle, 1)] + [TestCase(30, Link.Start, 1.8)] public void ChainCalculationTest(int index, Link link, double value) { diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/AverageRemotenessATSkewTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/AverageRemotenessATSkewTests.cs index e429bb2e..ac452518 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/AverageRemotenessATSkewTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/AverageRemotenessATSkewTests.cs @@ -32,6 +32,13 @@ public class AverageRemotenessATSkewTests : FullCalculatorsTests /// The value. /// - [TestCase(1, Link.None, 0.2290)] + [TestCase(1, Link.None, 0.229)] [TestCase(1, Link.Start, 0.3138)] [TestCase(1, Link.End, -0.2065)] [TestCase(1, Link.Both, -0.0862)] - [TestCase(1, Link.Cycle, 0.2050)] + [TestCase(1, Link.Cycle, 0.205)] [TestCase(2, Link.None, 1.444165399575)] [TestCase(2, Link.Start, 1.6566498)] [TestCase(2, Link.End, 2.369195368)] [TestCase(2, Link.Both, 1.550897715)] [TestCase(2, Link.Cycle, 2.14199532)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] + [TestCase(4, Link.Cycle, 0)] + public void CalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/AverageRemotenessSWSkewTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/AverageRemotenessSWSkewTests.cs index f01eb79d..1f035ca2 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/AverageRemotenessSWSkewTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/AverageRemotenessSWSkewTests.cs @@ -32,6 +32,13 @@ public class AverageRemotenessSWSkewTests : FullCalculatorsTests [TestCase(0, Link.Both, 1.0828)] [TestCase(0, Link.Cycle, 1.234)] + [TestCase(1, Link.None, 1.6726956021)] + [TestCase(1, Link.Start, 1.4943064208)] + [TestCase(1, Link.End, 1.4621136113)] + [TestCase(1, Link.Both, 1.3948590506)] + [TestCase(1, Link.Cycle, 1.8112989210)] + [TestCase(2, Link.None, 1.09749375)] [TestCase(2, Link.Start, 1.3299208)] [TestCase(2, Link.End, 1.17548874963)] [TestCase(2, Link.Both, 1.31922378713)] [TestCase(2, Link.Cycle, 1.5076815597)] - [TestCase(30, Link.Start, 0.7169925)] + [TestCase(3, Link.Start, 0.5)] + [TestCase(3, Link.End, 0.5)] + [TestCase(3, Link.Both, 0.5)] + [TestCase(3, Link.Cycle, 1)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] + [TestCase(4, Link.Cycle, 0)] + + [TestCase(5, Link.Start, 1.1462406252)] + [TestCase(5, Link.End, 1.1462406252)] + [TestCase(5, Link.Both, 1.1462406252)] + [TestCase(5, Link.Cycle, 2)] + + [TestCase(6, Link.None, 0)] + [TestCase(6, Link.Start, 1.102035074)] + [TestCase(6, Link.End, 0.654994643)] + [TestCase(6, Link.Both, 1.1181098199)] + [TestCase(6, Link.Cycle, 1.4888663952)] + + [TestCase(30, Link.None, 0.8616541669)] + [TestCase(30, Link.Start, 0.7169925001)] + [TestCase(30, Link.End, 0.7169925001)] + [TestCase(30, Link.Both, 0.654994643)] + [TestCase(30, Link.Cycle, 0.9169925001)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/DepthTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/DepthTests.cs index 903b38e0..110fb50a 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/DepthTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/DepthTests.cs @@ -33,6 +33,12 @@ public class DepthTests : FullCalculatorsTests [TestCase(2, Link.Both, 18.469133)] [TestCase(2, Link.Cycle, 15.076815597)] + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] + [TestCase(4, Link.Cycle, 0)] + [TestCase(30, Link.Start, 3.5849625)] public void CalculationTest(int index, Link link, double value) { diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/DescriptiveInformationTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/DescriptiveInformationTests.cs index 2b5bdd5e..973466f8 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/DescriptiveInformationTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/DescriptiveInformationTests.cs @@ -33,6 +33,12 @@ public class DescriptiveInformationTests : FullCalculatorsTests /// /// The value. /// - [TestCase(0, Link.Cycle, 1.095779)] - [TestCase(1, Link.Cycle, 2.16918)] - [TestCase(2, Link.Cycle, 1.67161)] - [TestCase(3, Link.Cycle, 0.25)] + [TestCase(0, Link.None, 0.0837994597)] + [TestCase(0, Link.Start, 0.0213224695)] + [TestCase(0, Link.End, 0.0289798985)] + [TestCase(0, Link.Both, 0.0245296327)] + [TestCase(0, Link.Cycle, 0.0413414702)] + + [TestCase(1, Link.None, 0.4277930442)] + [TestCase(1, Link.Start, 0.2142104318)] + [TestCase(1, Link.End, 0.0715719441)] + [TestCase(1, Link.Both, 0.0421851737)] + [TestCase(1, Link.Cycle, 0.0821234705)] + + [TestCase(2, Link.None, 0.5601737129)] + [TestCase(2, Link.Start, 0.3279369783)] + [TestCase(2, Link.End, 0.3226910516)] + [TestCase(2, Link.Both, 0.3584257504)] + [TestCase(2, Link.Cycle, 0.6590662815)] + + [TestCase(3, Link.Start, 0.25)] + [TestCase(3, Link.End, 0.25)] + [TestCase(3, Link.Both, 0)] + [TestCase(3, Link.Cycle, 0)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] [TestCase(4, Link.Cycle, 0)] - [TestCase(5, Link.Cycle, 2.25)] - [TestCase(6, Link.Cycle, 1.51137)] - [TestCase(7, Link.Cycle, 0.25)] - [TestCase(8, Link.Cycle, 0)] + + [TestCase(5, Link.Start, 0.5641589614)] + [TestCase(5, Link.End, 0.5641589614)] + [TestCase(5, Link.Both, 0)] + [TestCase(5, Link.Cycle, 0)] + + + [TestCase(6, Link.None, 0)] + [TestCase(6, Link.Start, 1.6361791053)] + [TestCase(6, Link.End, 0.1842595475)] + [TestCase(6, Link.Both, 0.4332629475)] + [TestCase(6, Link.Cycle, 0.9795918367)] + + [TestCase(30, Link.None, 0.2222222222)] + [TestCase(30, Link.Start, 0.1973881326)] + [TestCase(30, Link.End, 0.0166049037)] + [TestCase(30, Link.Both, 0.0421851737)] + [TestCase(30, Link.Cycle, 0.0821234705)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyKurtosisCoefficientTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyKurtosisCoefficientTests.cs index b4b42aa3..b0884f9c 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyKurtosisCoefficientTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyKurtosisCoefficientTests.cs @@ -21,15 +21,52 @@ public class EntropyKurtosisCoefficientTests : FullCalculatorsTests /// The value. /// - [TestCase(0, Link.Cycle, 1.00005)] - [TestCase(1, Link.Cycle, 1.00144)] - [TestCase(2, Link.Cycle, 1.00609)] - [TestCase(3, Link.Cycle, 1)] + [TestCase(0, Link.None, 1.0833333333)] + [TestCase(0, Link.Start, 1.7102130594)] + [TestCase(0, Link.End, 1.7252251832)] + [TestCase(0, Link.Both, 1.225)] + [TestCase(0, Link.Cycle, 1.1666666667)] + + [TestCase(1, Link.None, 1.7574356855)] + [TestCase(1, Link.Start, 1.2774883489)] + [TestCase(1, Link.End, 2.3342001534)] + [TestCase(1, Link.Both, 1.0833333333)] + [TestCase(1, Link.Cycle, 1.1666666667)] + + [TestCase(2, Link.None, 3.0354846197)] + [TestCase(2, Link.Start, 1.0940614369)] + [TestCase(2, Link.End, 2.6092565493)] + [TestCase(2, Link.Both, 1.4929907332)] + [TestCase(2, Link.Cycle, 1.8439986382)] + + [TestCase(3, Link.Start, 1)] + [TestCase(3, Link.End, 1)] + [TestCase(3, Link.Both, 0)] + [TestCase(3, Link.Cycle, 0)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] [TestCase(4, Link.Cycle, 0)] - [TestCase(5, Link.Cycle, 1)] - [TestCase(6, Link.Cycle, 1.00236)] - [TestCase(7, Link.Cycle, 1)] - [TestCase(8, Link.Cycle, 0)] + + [TestCase(5, Link.Start, 1.8027279195)] + [TestCase(5, Link.End, 1.8027279195)] + [TestCase(5, Link.Both, 0)] + [TestCase(5, Link.Cycle, 0)] + + + [TestCase(6, Link.None, 0)] + [TestCase(6, Link.Start, 1.1423674442)] + [TestCase(6, Link.End, 3.3687829924)] + [TestCase(6, Link.Both, 1.0333333333)] + [TestCase(6, Link.Cycle, 1.0833333333)] + + [TestCase(30, Link.None, 1.5)] + [TestCase(30, Link.Start, 1.1666666667)] + [TestCase(30, Link.End, 1.1666666667)] + [TestCase(30, Link.Both, 1.0833333333)] + [TestCase(30, Link.Cycle, 1.1666666667)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyKurtosisTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyKurtosisTests.cs index 20a35bdc..cc6ea130 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyKurtosisTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyKurtosisTests.cs @@ -21,15 +21,52 @@ public class EntropyKurtosisTests : FullCalculatorsTests /// /// The value. /// - [TestCase(0, Link.Cycle, 1.20079)] - [TestCase(1, Link.Cycle, 4.71197)] - [TestCase(2, Link.Cycle, 2.81132)] - [TestCase(3, Link.Cycle, 0.0625)] + [TestCase(0, Link.None, 0.0076075452)] + [TestCase(0, Link.Start, 0.0007775444)] + [TestCase(0, Link.End, 0.0014489037)] + [TestCase(0, Link.Both, 0.000737086)] + [TestCase(0, Link.Cycle, 0.00199397)] + + [TestCase(1, Link.None, 0.3216228368)] + [TestCase(1, Link.Start, 0.0586189698)] + [TestCase(1, Link.End, 0.0119570411)] + [TestCase(1, Link.Both, 0.001927888)] + [TestCase(1, Link.Cycle, 0.0078683085)] + + [TestCase(2, Link.None, 0.9525186474)] + [TestCase(2, Link.Start, 0.117658279)] + [TestCase(2, Link.End, 0.2717006183)] + [TestCase(2, Link.Both, 0.1918030542)] + [TestCase(2, Link.Cycle, 0.8009746706)] + + [TestCase(3, Link.Start, 0.0625)] + [TestCase(3, Link.End, 0.0625)] + [TestCase(3, Link.Both, 0)] + [TestCase(3, Link.Cycle, 0)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] [TestCase(4, Link.Cycle, 0)] - [TestCase(5, Link.Cycle, 5.0625)] - [TestCase(6, Link.Cycle, 2.289485)] - [TestCase(7, Link.Cycle, 0.0625)] - [TestCase(8, Link.Cycle, 0)] + + [TestCase(5, Link.Start, 0.5737638301)] + [TestCase(5, Link.End, 0.5737638301)] + [TestCase(5, Link.Both, 0)] + [TestCase(5, Link.Cycle, 0)] + + + [TestCase(6, Link.None, 0)] + [TestCase(6, Link.Start, 3.0582113959)] + [TestCase(6, Link.End, 0.1143755081)] + [TestCase(6, Link.Both, 0.1939740077)] + [TestCase(6, Link.Cycle, 1.0395668471)] + + [TestCase(30, Link.None, 0.0740740741)] + [TestCase(30, Link.Start, 0.045455754)] + [TestCase(30, Link.End, 0.0003216766)] + [TestCase(30, Link.Both, 0.001927888)] + [TestCase(30, Link.Cycle, 0.0078683085)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropySkewnessCoefficientTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropySkewnessCoefficientTests.cs index 287d8413..de6e82f4 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropySkewnessCoefficientTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropySkewnessCoefficientTests.cs @@ -21,15 +21,52 @@ public class EntropySkewnessCoefficientTests : FullCalculatorsTests /// The value. /// - [TestCase(0, Link.Cycle, -1.00002)] - [TestCase(1, Link.Cycle, -1.00054)] - [TestCase(2, Link.Cycle, -1.00223)] - [TestCase(3, Link.Cycle, -1)] + [TestCase(0, Link.None, 0.2886751346)] + [TestCase(0, Link.Start, 0.6128535448)] + [TestCase(0, Link.End, -0.7044864198)] + [TestCase(0, Link.Both, -0.474341649)] + [TestCase(0, Link.Cycle, -0.4082482905)] + + [TestCase(1, Link.None, 0.1264522237)] + [TestCase(1, Link.Start, 0.3623575326)] + [TestCase(1, Link.End, 0.7446392945)] + [TestCase(1, Link.Both, 0.2886751346)] + [TestCase(1, Link.Cycle, 0.4082482905)] + + [TestCase(2, Link.None, 0.3258684199)] + [TestCase(2, Link.Start, 0.0679609575)] + [TestCase(2, Link.End, 1.1185300891)] + [TestCase(2, Link.Both, 0.0562260608)] + [TestCase(2, Link.Cycle, 0.4310471138)] + + [TestCase(3, Link.Start, 0)] + [TestCase(3, Link.End, 0)] + [TestCase(3, Link.Both, 0)] + [TestCase(3, Link.Cycle, 0)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] [TestCase(4, Link.Cycle, 0)] - [TestCase(5, Link.Cycle, -1)] - [TestCase(6, Link.Cycle, -1.00088)] - [TestCase(7, Link.Cycle, -1)] - [TestCase(8, Link.Cycle, 0)] + + [TestCase(5, Link.Start, -0.4733901994)] + [TestCase(5, Link.End, -0.4733901994)] + [TestCase(5, Link.Both, 0)] + [TestCase(5, Link.Cycle, 0)] + + + [TestCase(6, Link.None, 0)] + [TestCase(6, Link.Start, 0.3195924049)] + [TestCase(6, Link.End, -0.2511254465)] + [TestCase(6, Link.Both, -0.1825741858)] + [TestCase(6, Link.Cycle, 0.2886751346)] + + [TestCase(30, Link.None, 0.7071067812)] + [TestCase(30, Link.Start, 0.4082482905)] + [TestCase(30, Link.End, 0.4082482905)] + [TestCase(30, Link.Both, 0.2886751346)] + [TestCase(30, Link.Cycle, 0.4082482905)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropySkewnessTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropySkewnessTests.cs index 11d6a7fe..a1e4bcfc 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropySkewnessTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropySkewnessTests.cs @@ -21,15 +21,52 @@ public class EntropySkewnessTests : FullCalculatorsTests /// /// The value. /// - [TestCase(0, Link.Cycle, -1.14708)] - [TestCase(1, Link.Cycle, -3.1965)] - [TestCase(2, Link.Cycle, -2.16606)] - [TestCase(3, Link.Cycle, -0.125)] + [TestCase(0, Link.None, 0.0070027916)] + [TestCase(0, Link.Start, 0.0019081519)] + [TestCase(0, Link.End, -0.003475505)] + [TestCase(0, Link.Both, -0.0018223334)] + [TestCase(0, Link.Cycle, -0.0034316521)] + + [TestCase(1, Link.None, 0.0353815658)] + [TestCase(1, Link.Start, 0.0359251193)] + [TestCase(1, Link.End, 0.0142580512)] + [TestCase(1, Link.Both, 0.0025012041)] + [TestCase(1, Link.Cycle, 0.0096078301)] + + [TestCase(2, Link.None, 0.1366238006)] + [TestCase(2, Link.Start, 0.0127627739)] + [TestCase(2, Link.End, 0.2050350246)] + [TestCase(2, Link.Both, 0.0120652538)] + [TestCase(2, Link.Cycle, 0.2306313714)] + + [TestCase(3, Link.Start, 0)] + [TestCase(3, Link.End, 0)] + [TestCase(3, Link.Both, 0)] + [TestCase(3, Link.Cycle, 0)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] [TestCase(4, Link.Cycle, 0)] - [TestCase(5, Link.Cycle, -3.375)] - [TestCase(6, Link.Cycle, -1.859589)] - [TestCase(7, Link.Cycle, -0.125)] - [TestCase(8, Link.Cycle, 0)] + + [TestCase(5, Link.Start, -0.2005956445)] + [TestCase(5, Link.End, -0.2005956445)] + [TestCase(5, Link.Both, 0)] + [TestCase(5, Link.Cycle, 0)] + + + [TestCase(6, Link.None, 0)] + [TestCase(6, Link.Start, 0.6688715333)] + [TestCase(6, Link.End, -0.0198625829)] + [TestCase(6, Link.Both, -0.0520674966)] + [TestCase(6, Link.Cycle, 0.2798833819)] + + [TestCase(30, Link.None, 0.0740740741)] + [TestCase(30, Link.Start, 0.0358018882)] + [TestCase(30, Link.End, 0.0008735322)] + [TestCase(30, Link.Both, 0.0025012041)] + [TestCase(30, Link.Cycle, 0.0096078301)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyStandardDeviationTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyStandardDeviationTests.cs index 6e78a2ec..5d84bb83 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyStandardDeviationTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/EntropyStandardDeviationTests.cs @@ -21,15 +21,52 @@ public class EntropyStandardDeviationTests : FullCalculatorsTests /// The value. /// - [TestCase(0, Link.Cycle, 1.046795)] - [TestCase(1, Link.Cycle, 1.47281)] - [TestCase(2, Link.Cycle, 1.29291)] - [TestCase(3, Link.Cycle, 0.5)] + [TestCase(0, Link.None, 0.2894813634)] + [TestCase(0, Link.Start, 0.1460221541)] + [TestCase(0, Link.End, 0.1702348333)] + [TestCase(0, Link.Both, 0.1566193881)] + [TestCase(0, Link.Cycle, 0.2033260195)] + + [TestCase(1, Link.None, 0.6540588996)] + [TestCase(1, Link.Start, 0.4628287284)] + [TestCase(1, Link.End, 0.2675293331)] + [TestCase(1, Link.Both, 0.2053902959)] + [TestCase(1, Link.Cycle, 0.2865719291)] + + [TestCase(2, Link.None, 0.7484475352)] + [TestCase(2, Link.Start, 0.5726578196)] + [TestCase(2, Link.End, 0.5680590212)] + [TestCase(2, Link.Both, 0.598686688)] + [TestCase(2, Link.Cycle, 0.8118289731)] + + [TestCase(3, Link.Start, 0.5)] + [TestCase(3, Link.End, 0.5)] + [TestCase(3, Link.Both, 0)] + [TestCase(3, Link.Cycle, 0)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] [TestCase(4, Link.Cycle, 0)] - [TestCase(5, Link.Cycle, 1.5)] - [TestCase(6, Link.Cycle, 1.22938)] - [TestCase(7, Link.Cycle, 0.5)] - [TestCase(8, Link.Cycle, 0)] + + [TestCase(5, Link.Start, 0.75110516)] + [TestCase(5, Link.End, 0.75110516)] + [TestCase(5, Link.Both, 0)] + [TestCase(5, Link.Cycle, 0)] + + + [TestCase(6, Link.None, 0)] + [TestCase(6, Link.Start, 1.2791321688)] + [TestCase(6, Link.End, 0.4292546418)] + [TestCase(6, Link.Both, 0.6582271245)] + [TestCase(6, Link.Cycle, 0.9897433186)] + + [TestCase(30, Link.None, 0.4714045208)] + [TestCase(30, Link.Start, 0.4442838424)] + [TestCase(30, Link.End, 0.1288600158)] + [TestCase(30, Link.Both, 0.2053902959)] + [TestCase(30, Link.Cycle, 0.2865719291)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/GeometricMeanTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/GeometricMeanTests.cs index fefe23c7..d237ca18 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/GeometricMeanTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/GeometricMeanTests.cs @@ -33,6 +33,12 @@ public class GeometricMeanTests : FullCalculatorsTests [TestCase(2, Link.Both, 2.4953181811241978)] [TestCase(2, Link.Cycle, 2.843527111557)] + [TestCase(4, Link.None, 1)] + [TestCase(4, Link.Start, 1)] + [TestCase(4, Link.End, 1)] + [TestCase(4, Link.Both, 1)] + [TestCase(4, Link.Cycle, 1)] + [TestCase(30, Link.Start, 1.6437518295)] public void CalculationTest(int index, Link link, double value) { diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/IdentificationInformationTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/IdentificationInformationTests.cs index a4128896..aa1eeeec 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/IdentificationInformationTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/IdentificationInformationTests.cs @@ -27,13 +27,45 @@ public class IdentificationInformationTests : FullCalculatorsTests [TestCase(2, Link.End, 10)] [TestCase(2, Link.Both, 14)] [TestCase(2, Link.Cycle, 10)] + + [TestCase(4, Link.None, 3)] + [TestCase(4, Link.Start, 4)] + [TestCase(4, Link.End, 4)] + [TestCase(4, Link.Both, 5)] + [TestCase(4, Link.Cycle, 4)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/IntervalsSumTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/IntervalsSumTests.cs index f87496a4..8706596b 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/IntervalsSumTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/IntervalsSumTests.cs @@ -32,6 +32,12 @@ public class IntervalsSumTests : FullCalculatorsTests [TestCase(2, Link.End, 28)] [TestCase(2, Link.Both, 44)] [TestCase(2, Link.Cycle, 40)] + + [TestCase(4, Link.None, 3)] + [TestCase(4, Link.Start, 4)] + [TestCase(4, Link.End, 4)] + [TestCase(4, Link.Both, 5)] + [TestCase(4, Link.Cycle, 4)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/PeriodicityTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/PeriodicityTests.cs index 11767727..14ff8d9f 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/PeriodicityTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/PeriodicityTests.cs @@ -33,6 +33,12 @@ public class PeriodicityTests : FullCalculatorsTests [TestCase(2, Link.Both, 0.7939648758)] [TestCase(2, Link.Cycle, 0.71088177788925)] + [TestCase(4, Link.None, 1)] + [TestCase(4, Link.Start, 1)] + [TestCase(4, Link.End, 1)] + [TestCase(4, Link.Both, 1)] + [TestCase(4, Link.Cycle, 1)] + [TestCase(30, Link.Start, 0.91319546)] public void ChainCalculationTest(int index, Link link, double value) { diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RegularityTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RegularityTests.cs index 47af5816..24224c01 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RegularityTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RegularityTests.cs @@ -33,6 +33,12 @@ public class RegularityTests : FullCalculatorsTests [TestCase(2, Link.Both, 0.86439343863)] [TestCase(2, Link.Cycle, 0.838985343)] + [TestCase(4, Link.None, 1)] + [TestCase(4, Link.Start, 1)] + [TestCase(4, Link.End, 1)] + [TestCase(4, Link.Both, 1)] + [TestCase(4, Link.Cycle, 1)] + [TestCase(30, Link.Start, 0.9587)] public void ChainCalculationTest(int index, Link link, double value) { diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessDispersionTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessDispersionTests.cs index ed19fe85..c8dceed5 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessDispersionTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessDispersionTests.cs @@ -26,6 +26,47 @@ public class RemotenessDispersionTests : FullCalculatorsTests [TestCase(0, Link.End, 0.7288246)] [TestCase(0, Link.Both, 0.888077)] [TestCase(0, Link.Cycle, 1.6655934)] + + [TestCase(1, Link.None, 1.674332994)] + [TestCase(1, Link.Start, 1.4471693596)] + [TestCase(1, Link.End, 1.3683536511)] + [TestCase(1, Link.Both, 1.2688567516)] + [TestCase(1, Link.Cycle, 1.2751326476)] + + [TestCase(2, Link.None, 1.4101100504)] + [TestCase(2, Link.Start, 1.7828429408)] + [TestCase(2, Link.End, 1.4114296444)] + [TestCase(2, Link.Both, 1.6728319397)] + [TestCase(2, Link.Cycle, 3.55665678)] + + [TestCase(3, Link.Start, 0.0625)] + [TestCase(3, Link.End, 0.0625)] + [TestCase(3, Link.Both, 0.0625)] + [TestCase(3, Link.Cycle, 0)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] + [TestCase(4, Link.Cycle, 0)] + + [TestCase(5, Link.Start, 0.5737638301)] + [TestCase(5, Link.End, 0.5737638301)] + [TestCase(5, Link.Both, 0.5737638301)] + [TestCase(5, Link.Cycle, 0)] + + + [TestCase(6, Link.None, 0)] + [TestCase(6, Link.Start, 3.0582113959)] + [TestCase(6, Link.End, 0.6815665337)] + [TestCase(6, Link.Both, 2.1217880591)] + [TestCase(6, Link.Cycle, 3.4108669694)] + + [TestCase(30, Link.None, 0.2751024121)] + [TestCase(30, Link.Start, 0.2217903986)] + [TestCase(30, Link.End, 0.2217903986)] + [TestCase(30, Link.Both, 0.1918030542)] + [TestCase(30, Link.Cycle, 0.1812587393)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessSkewnessCoefficientTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessSkewnessCoefficientTests.cs index ab614e80..f58200f7 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessSkewnessCoefficientTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessSkewnessCoefficientTests.cs @@ -26,6 +26,47 @@ public class RemotenessSkewnessCoefficientTests : FullCalculatorsTests [TestCase(0, Link.End, -0.0991305)] [TestCase(0, Link.Both, -0.1347675)] [TestCase(0, Link.Cycle, -0.1599169)] + + [TestCase(1, Link.None, -0.4961683303)] + [TestCase(1, Link.Start, -0.2949014953)] + [TestCase(1, Link.End, -0.258364351)] + [TestCase(1, Link.Both, -0.2054047141)] + [TestCase(1, Link.Cycle, -0.4660579801)] + + [TestCase(2, Link.None, 0.2300877488)] + [TestCase(2, Link.Start, -0.0632986581)] + [TestCase(2, Link.End, 0.1340349233)] + [TestCase(2, Link.Both, -0.0406344674)] + [TestCase(2, Link.Cycle, 0.1510267759)] + + [TestCase(3, Link.Start, 0)] + [TestCase(3, Link.End, 0)] + [TestCase(3, Link.Both, 0)] + [TestCase(3, Link.Cycle, 0)] + + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] + [TestCase(4, Link.Cycle, 0)] + + [TestCase(5, Link.Start, -0.2005956445)] + [TestCase(5, Link.End, -0.2005956445)] + [TestCase(5, Link.Both, -0.2005956445)] + [TestCase(5, Link.Cycle, 0)] + + + [TestCase(6, Link.None, 0)] + [TestCase(6, Link.Start, 0.6688715333)] + [TestCase(6, Link.End, 0.3077841313)] + [TestCase(6, Link.Both, 0.3198087858)] + [TestCase(6, Link.Cycle, -0.4130639215)] + + [TestCase(30, Link.None, -0.0862228839)] + [TestCase(30, Link.Start, -0.0075884574)] + [TestCase(30, Link.End, -0.0075884574)] + [TestCase(30, Link.Both, 0.0120652538)] + [TestCase(30, Link.Cycle, -0.0942645986)] public void ChainCalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessStandardDeviationTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessStandardDeviationTests.cs index dff9e7a7..f45736f8 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessStandardDeviationTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/RemotenessStandardDeviationTests.cs @@ -26,6 +26,47 @@ public class RemotenessStandardDeviationTests : FullCalculatorsTests [TestCase(2, Link.Both, 0.2102399737463)] [TestCase(2, Link.Cycle, 0.25328248774368)] + [TestCase(4, Link.None, 0)] + [TestCase(4, Link.Start, 0)] + [TestCase(4, Link.End, 0)] + [TestCase(4, Link.Both, 0)] + [TestCase(4, Link.Cycle, 0)] + [TestCase(30, Link.Start, 0.06080123752225)] public void ChainCalculationTest(int index, Link link, double value) { diff --git a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/VolumeTests.cs b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/VolumeTests.cs index 7d636157..990807da 100644 --- a/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/VolumeTests.cs +++ b/Libiada.Core.Tests/Core/Characteristics/Calculators/FullCalculators/VolumeTests.cs @@ -32,6 +32,12 @@ public class VolumeTests : FullCalculatorsTests [TestCase(2, Link.End, 3456)] [TestCase(2, Link.Both, 362880)] [TestCase(2, Link.Cycle, 34560)] + + [TestCase(4, Link.None, 1)] + [TestCase(4, Link.Start, 1)] + [TestCase(4, Link.End, 1)] + [TestCase(4, Link.Both, 1)] + [TestCase(4, Link.Cycle, 1)] public void CalculationTest(int index, Link link, double value) { ChainCharacteristicTest(index, link, value); diff --git a/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/AlphabeticAverageRemoteness.cs b/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/AlphabeticAverageRemoteness.cs index ea61c048..45d40cd7 100644 --- a/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/AlphabeticAverageRemoteness.cs +++ b/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/AlphabeticAverageRemoteness.cs @@ -24,6 +24,7 @@ public double Calculate(Chain chain, Link link) if (geometricMean == 0) return 0; int alphabetCardinality = chain.Alphabet.Cardinality; + if (alphabetCardinality <= 1) return 0; return Math.Log(geometricMean, alphabetCardinality); } diff --git a/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/AlphabeticDepth.cs b/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/AlphabeticDepth.cs index 1e7b922b..0b35920b 100644 --- a/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/AlphabeticDepth.cs +++ b/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/AlphabeticDepth.cs @@ -21,6 +21,8 @@ public double Calculate(Chain chain, Link link) { double result = 0; int alphabetCardinality = chain.Alphabet.Cardinality; + if (alphabetCardinality <= 1) return 0; + for (int i = 0; i < alphabetCardinality; i++) { result += Calculate(chain.CongenericChain(i), link, alphabetCardinality); diff --git a/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/GeometricMean.cs b/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/GeometricMean.cs index c419caa9..8f85f1f6 100644 --- a/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/GeometricMean.cs +++ b/Libiada.Core/Core/Characteristics/Calculators/FullCalculators/GeometricMean.cs @@ -19,8 +19,11 @@ public class GeometricMean : IFullCalculator /// public double Calculate(Chain chain, Link link) { + double intervalsCount = new IntervalsCount().Calculate(chain, link); + if (intervalsCount == 0) return 0; + double remoteness = new AverageRemoteness().Calculate(chain, link); - return remoteness == 0 ? 0 : Math.Pow(2, remoteness); + return Math.Pow(2, remoteness); } }