Beispiel #1
0
 public BackPropagationInfo()
 {
     LearningRate = new SimpleOrExpression <double>(1e-4);
     Momentum     = new SimpleOrExpression <double>(0.9);
     L1           = new SimpleOrExpression <double>(0);
     L2           = new SimpleOrExpression <double>(1e-11);
 }
Beispiel #2
0
 public SearchAgentInfo()
 {
     InitialState      = new AnonymousGeneralVariableInfo();
     Problem           = new SimpleOrExpression <ProblemInfo>();
     HeuristicFunction = new EnabledFeature <AnonymousGeneralVariableInfo <HeuristicFunction> >();
     Search            = new SimpleOrExpression <SearchInfo>();
 }
Beispiel #3
0
 public DynamicCSPInfo()
 {
     Variables       = new AnonymousGeneralVariableInfo <IEnumerable>();
     Constraints     = new AnonymousGeneralVariableInfo <IEnumerable <Constraint> >();
     Domains         = new Variables <IEnumerable>();
     VariableDomains = new SimpleOrExpression <SerializableDictionary <string, string> >();
 }
        public IEnumerable <RedditAnswer> ParseThing(Thing objThing, PortalKeeperContext <ScheduleEvent> actionContext) //where TEngineEvent : IConvertible
        {
            var toReturn = new List <RedditAnswer>();


            if (EnableAllUsers || SimpleOrExpression <String> .GetValues(CommandUsers.ToArray(), actionContext, actionContext).Contains(objThing.AuthorName))
            {
                var parentsParsed = false;
                var message       = ParseThingVariables(objThing, actionContext, "", 0);

                foreach (var objRegex in BuiltRegexes)
                {
                    var objMatch = objRegex.Match(message);
                    if (objMatch.Success)
                    {
                        var previousAnswer = GetExistingAnswer(objThing);
                        // We only proceed with messages we have not answered yet
                        if (previousAnswer == null)
                        {
                            if (ParsingDepth > 0)
                            {
                                if (!parentsParsed)
                                {
                                    ParseThingVariables(objThing.ParentThing, actionContext, "Parent", ParsingDepth - 1);
                                    parentsParsed = true;
                                }
                            }
                            foreach (string groupName in objRegex.GetGroupNames())
                            {
                                actionContext.SetVar(groupName, objMatch.Groups[groupName].Value);
                            }

                            foreach (var objRedditAction in RedditAnswers)
                            {
                                if (objRedditAction.IsMatch(actionContext))
                                {
                                    toReturn.Add(objRedditAction);
                                }
                            }
                        }
                        else
                        {
                            //var candidateThings = previousAnswer.Children;
                            //foreach (var candidateThing in candidateThings)
                            //{
                            //    foreach (var command in NextCommands)
                            //    {
                            //       toReturn = toReturn | command.ParseThing(candidateThing, actionContext);
                            //    }
                            //}
                        }

                        return(toReturn);
                    }
                }
            }

            return(toReturn);
        }
Beispiel #5
0
 public PLKbInferInfo()
 {
     KnowledgeBase = new AnonymousGeneralVariableInfo <KnowledgeBase>();
     Predicate     = new SimpleOrExpression <string>();
     Procedure     = new AnonymousGeneralVariableInfo <PLKbInferProcedureInfo>()
     {
         VariableMode = VariableMode.Instance,
     };
 }
 public GameAgentInfo()
 {
     Game     = new AnonymousGeneralVariableInfo <Game>();
     State    = new AnonymousGeneralVariableInfo();
     Strategy = new SimpleOrExpression <GameStrategyInfo>();
 }
Beispiel #7
0
 public FolKbInferInfo()
 {
     KnowledgeBase = new AnonymousGeneralVariableInfo <FOLKnowledgeBase>();
     Predicate     = new SimpleOrExpression <string>();
 }