コード例 #1
0
ファイル: Equation.cs プロジェクト: lmorisse/Symu.SysDyn
        public async Task <Equation> Clone(string model)
        {
            var equation = new Equation(Expression.OriginalExpression);

            if (Expression.HasErrors())
            {
                //todo Error management
                // This information should be thrown to StateMachine
                return(null);
            }

            equation._canBeOptimized = _canBeOptimized;
            if (Variables.Any())
            {
                equation.Variables.AddRange(Variables);
            }
            else
            {
                // To initialize Expression.LastValue
                await Expression.EvaluateAsync(0, 0, 1);
            }

            return(equation);
        }