Exemple #1
0
        internal ActionInfo(object model, MethodInfo method, ActionKind kind, ModelProgramProvider mpp)
        {
            this.actionSymbol                   = new ActionSymbol(GetActionName(method), GetActionArity(method, kind), kind);
            this.model                          = model;
            this.method                         = method;
            this.inputParameterTypes            = GetInputParameterTypes(method);
            this.parameterlessEnablingCondition = new EnablingCondition(this, true, true);
            this.enablingCondition              = new EnablingCondition(this, true, false);
            this.parameterInfos                 = method.GetParameters();

            defaultInputParameters = new object[inputParameterTypes.Length];
            for (int i = 0; i < defaultInputParameters.Length; i++)
            {
                defaultInputParameters[i] =
                    (mpp.GetEnumDomain(inputParameterTypes[i]).Values.Length == 0 ? 0 :
                     mpp.GetEnumDomain(inputParameterTypes[i]).Values[0]);
            }

            //Create input parameter generators
            InitializeInputParameterCombinations(mpp, new EnablingCondition(this, false, false));
        }
Exemple #2
0
        private void InitializeInputParameterCombinations(ModelProgramProvider mpp, EnablingCondition stateIndependentCondition)
        {
            List <InputParameterDomain> paramDomains = new List <InputParameterDomain>();

            foreach (ParameterInfo paramInfo in parameterInfos)
            {
                if (!paramInfo.IsOut)
                {
                    EnumDomain D = mpp.GetEnumDomain(paramInfo.ParameterType);
                    paramDomains.Add(new InputParameterDomain(D, IsParmeterPlaceholder(paramInfo)));
                }
            }
            this.inputParameterCombinations = new InputParameterCombinations(mpp.ParameterGenerator(this.actionSymbol), paramDomains.ToArray(), stateIndependentCondition);
        }
 private void InitializeInputParameterCombinations(ModelProgramProvider mpp, EnablingCondition stateIndependentCondition)
 {
     List<InputParameterDomain> paramDomains = new List<InputParameterDomain>();
     foreach (ParameterInfo paramInfo in parameterInfos)
     {
         if (!paramInfo.IsOut)
         {
             EnumDomain D = mpp.GetEnumDomain(paramInfo.ParameterType);
             paramDomains.Add(new InputParameterDomain(D, IsParmeterPlaceholder(paramInfo)));
         }
     }
     this.inputParameterCombinations = new InputParameterCombinations(mpp.ParameterGenerator(this.actionSymbol), paramDomains.ToArray(), stateIndependentCondition);
 }
        internal ActionInfo(object model, MethodInfo method, ActionKind kind, ModelProgramProvider mpp)
        {
            this.actionSymbol = new ActionSymbol(GetActionName(method), GetActionArity(method, kind), kind);
            this.model = model;
            this.method = method;
            this.inputParameterTypes = GetInputParameterTypes(method);
            this.parameterlessEnablingCondition = new EnablingCondition(this, true, true);
            this.enablingCondition = new EnablingCondition(this, true, false);
            this.parameterInfos = method.GetParameters();

            defaultInputParameters = new object[inputParameterTypes.Length];
            for (int i = 0; i < defaultInputParameters.Length; i++)
                defaultInputParameters[i] =
                    (mpp.GetEnumDomain(inputParameterTypes[i]).Values.Length == 0 ? 0 :
                     mpp.GetEnumDomain(inputParameterTypes[i]).Values[0]);

            //Create input parameter generators
            InitializeInputParameterCombinations(mpp, new EnablingCondition(this, false, false));
        }