private DomainValue Evaluate()
        {
            var theDomainExpression = Context.DomainExpression;

            switch (theDomainExpression.Inner)
            {
            case RangeDomainExpressionNode rangeDomainExpressionNode:
                return(DomainExpressionEvaluator.Evaluate(rangeDomainExpressionNode, Context.Model));

            case ListDomainExpressionNode listDomainExpressionNode:
                return(DomainExpressionEvaluator.Evaluate(listDomainExpressionNode));

            case TableExpressionNode tableRangeNode:
                return(new DomainExpressionEvaluator().Evaluate(tableRangeNode, Context.Workspace));

            default:
                throw new NotImplementedException("Unknown domain expression.");
            }
        }
Exemplo n.º 2
0
        internal static DomainValue Evaluate(VariableDomainExpressionEvaluatorContext theContext)
        {
            var theDomainExpression = theContext.DomainExpression;

            switch (theDomainExpression.Inner)
            {
            case SharedDomainReferenceNode domainReferenceNode:
                return(DomainExpressionEvaluator.Evaluate(domainReferenceNode, theContext.Workspace));

            case RangeDomainExpressionNode rangeExpressionNode:
                return(DomainExpressionEvaluator.Evaluate(rangeExpressionNode, theContext.Model));

            case ListDomainExpressionNode listDomainExpressionNode:
                return(DomainExpressionEvaluator.Evaluate(listDomainExpressionNode));

            case TableExpressionNode tableRangeNode:
                return(new DomainExpressionEvaluator().Evaluate(tableRangeNode, theContext.Workspace));

            default:
                throw new NotImplementedException("Unknown variable domain expression.");
            }
        }