Пример #1
0
 private void buttonAddOrEditGoal_Click(object sender, System.EventArgs e)
 {
     try
     {
         goal.Name         = textBoxGoalName.Value.ToString();
         goal.Significance = floatFieldBoxSignificance.Value;
         goal.Likelihood   = floatFieldBoxLikelihood.Value;
         ea.AddOrUpdateGoal(goal);
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     Close();
 }
Пример #2
0
        private static RolePlayCharacterAsset BuildEmotionalRPCAsset(int eaSet = -1)
        {
            var kb = new KB((Name)"Matt");


            var ea = new EmotionalAppraisalAsset();


            if (eaSet == -1)
            {
                var appraisalRule = new EmotionalAppraisal.DTOs.AppraisalRuleDTO()
                {
                    Conditions            = new Conditions.DTOs.ConditionSetDTO(),
                    EventMatchingTemplate = (Name)"Event(*, *,*, *)",
                    AppraisalVariables    = new AppraisalVariables(new List <AppraisalVariableDTO>()
                    {
                        new AppraisalVariableDTO()
                        {
                            Name  = OCCAppraisalVariables.DESIRABILITY,
                            Value = (Name)"2"
                        },
                        new AppraisalVariableDTO()
                        {
                            Name  = OCCAppraisalVariables.PRAISEWORTHINESS,
                            Value = (Name)"2"
                        }
                    })
                };

                ea.AddOrUpdateAppraisalRule(appraisalRule);
            }

            else
            {
                PopulateAppraisalRuleSet();
                ea.AddOrUpdateAppraisalRule(appraisalRuleSet[eaSet]);
            }

            ea.AddOrUpdateGoal(new GoalDTO()
            {
                Name         = "Goal",
                Significance = 5,
                Likelihood   = 0.5f
            });

            ea.AddOrUpdateGoal(new GoalDTO()
            {
                Name         = "GoalNegative",
                Significance = 5,
                Likelihood   = 0.2f
            });

            ea.AddOrUpdateGoal(new GoalDTO()
            {
                Name         = "GoalPositive",
                Significance = 5,
                Likelihood   = 0.8f
            });

            var rpc = new RolePlayCharacterAsset
            {
                BodyName      = "Male",
                VoiceName     = "Male",
                CharacterName = (Name)"Matt",
                m_kb          = kb,
            };

            rpc.m_emotionalAppraisalAsset = ea;

            rpc.BindToRegistry(rpc.m_kb);



            EmotionalDecisionMakingAsset edm = new EmotionalDecisionMakingAsset();
            SocialImportanceAsset        si  = new SocialImportanceAsset();
            CommeillFautAsset            cfa = new CommeillFautAsset();

            rpc.m_emotionalAppraisalAsset      = ea;
            rpc.m_emotionalDecisionMakingAsset = edm;
            rpc.m_socialImportanceAsset        = si;
            rpc.m_commeillFautAsset            = cfa;
            return(rpc);
        }