public Optional <List <InitialData> > GetInitialData()
        {
            if (!File.Exists(_filePathProvider.FilePath))
            {
                throw new FileNotFoundException(nameof(_filePathProvider.FilePath));
            }

            string                    initialDataFilePath = _filePathProvider.FilePath;
            List <string[]>           parsingResult       = _csvParser.ParseFile(initialDataFilePath);
            ValidationOperationResult operationResult     = _validator.Validate(parsingResult);

            if (operationResult.Successful)
            {
                List <InitialData> initialData = parsingResult.Select(
                    strings => new InitialData(
                        strings[0],
                        double.Parse(strings[1], CultureInfo.InvariantCulture),
                        double.Parse(strings[2], CultureInfo.InvariantCulture)))
                                                 .ToList();
                return(Optional <List <InitialData> > .For(initialData));
            }

            _validationOperationResultLogger.LogValidationOperationResultMessages(operationResult);
            return(Optional <List <InitialData> > .Empty());
        }
        public Optional <KnowledgeBase> GetKnowledgeBase(string profileName)
        {
            var implicationRules    = _implicationRuleManager.GetImplicationRules(profileName);
            var linguisticVariables = _linguisticVariableManager.GetLinguisticVariables(profileName);

            if (!implicationRules.IsPresent || !linguisticVariables.IsPresent)
            {
                return(Optional <KnowledgeBase> .Empty());
            }

            var validationOperationResult = _knowledgeBaseValidator.ValidateLinguisticVariablesNames(
                implicationRules.Value.Select(ir => ir.Value).ToList(),
                linguisticVariables.Value.Select(lv => lv.Value).ToList());

            if (validationOperationResult.Successful)
            {
                var linguisticVariablesRelations = _linguisticVariableRelationsInitializer.FormRelations(implicationRules.Value, linguisticVariables.Value);
                return(Optional <KnowledgeBase> .For(new KnowledgeBase(implicationRules.Value, linguisticVariables.Value, linguisticVariablesRelations)));
            }

            _validationOperationResultLogger.LogValidationOperationResultMessages(validationOperationResult);
            return(Optional <KnowledgeBase> .Empty());
        }