예제 #1
0
        public Assignment SolveCSP(object owner, IContextLookup globalVars)
        {
            var objStrategy  = Strategy.EvaluateTyped(owner, globalVars);
            var objListeners = StateListeners.EvaluateGeneric(owner, globalVars);

            foreach (KeyValuePair <string, CSPStateListener> keyValuePairListener in objListeners)
            {
                objStrategy.addCSPStateListener(keyValuePairListener.Value);
                globalVars.Items[keyValuePairListener.Key] = keyValuePairListener.Value;
            }
            var objCSP = CSP.EvaluateTyped(owner, globalVars);

            return(objStrategy.solve(objCSP));
        }