DaySim
DaySim copied to clipboard
Missing coefficients file should throw an exception
No warning or exception is thrown if a coefficent file cannot be found.
public ChoiceProbabilityFactory(string coefficientsPath, bool modelIsInEstimationMode, int totalAlternatives, int totalNestedAlternatives, int totalLevels, int maxParameter, ICoefficientsReader reader = null) {
ICoefficientsReader coefficientsReader = null;
if (reader != null) {
coefficientsReader = reader;
}
if (reader == null) {
FileInfo file = new FileInfo(coefficientsPath);
if (file.Exists) {
coefficientsReader = new CoefficientsReader();
}
}
if (coefficientsReader == null) {
}
if (coefficientsReader != null) {
_coefficients = coefficientsReader.Read(coefficientsPath, out _title, out _sizeFunctionMultiplier,
out ICoefficient nestCoefficient);
}
_modelIsInEstimationMode = modelIsInEstimationMode;
_totalAlternatives = totalAlternatives;
_totalNestedAlternatives = totalNestedAlternatives;
_totalLevels = totalLevels;
_totalUtilities = maxParameter + 1;
}