Changes to accomodate unit tests.

This commit is contained in:
2024-08-01 17:25:48 -04:00
parent 7f48834f23
commit 0d41cbaaf1

View File

@@ -118,7 +118,8 @@ namespace MarketData.Generator.CMMomentum
}
return true;
}
private static void PredictCandidate(CMCandidate cmCandidate,CMParams cmParams)
// This method is made public in order that it can be tested
public static bool PredictCandidate(CMCandidate cmCandidate,CMParams cmParams)
{
try
{
@@ -138,12 +139,12 @@ namespace MarketData.Generator.CMMomentum
cmCandidate.Score*=(1.00+cmParams.UseCNNRewardPercentDecimal); // increase the score by the percentage indicated in the params settings
cmCandidate.CNNPrediction=true;
}
return;
return true;
}
catch(Exception exception)
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Error encountered calling convolutional model at {0}. Exception was {1}",cmParams.UseCNNHost,exception.ToString()));
return;
return false;
}
}
}