private void Reset(bool newFile)
        {
            if (newFile)
            {
                this.Text      = Resources.MainFormTitle;
                this._edmAsset = new EmotionalDecisionMakingAsset();
            }
            else
            {
                this.Text = Resources.MainFormTitle + " - " + _saveFileName;
            }

            this._reactiveActions = new BindingListView <ReactionDTO>(_edmAsset.GetAllReactions().ToList());
            dataGridViewReactiveActions.DataSource = this._reactiveActions;
            dataGridViewReactiveActions.Columns[PropertyUtil.GetName <ReactionDTO>(dto => dto.Id)].Visible         = false;
            dataGridViewReactiveActions.Columns[PropertyUtil.GetName <ReactionDTO>(dto => dto.Conditions)].Visible = false;


            if (_reactiveActions.Any())
            {
                this._conditions = new BindingListView <ConditionDTO>(_edmAsset.GetReactionsConditions(_reactiveActions.First().Id).ToList());
            }
            else
            {
                this._conditions = new BindingListView <ConditionDTO>(new List <ConditionDTO>());
            }

            dataGridViewReactionConditions.DataSource = this._conditions;
            dataGridViewReactionConditions.Columns[PropertyUtil.GetName <ConditionDTO>(dto => dto.Id)].Visible = false;

            comboBoxQuantifierType.DataSource = Enum.GetNames(typeof(LogicalQuantifier));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads the associated assets from the defined sources and prevents further authoring of the asset
        /// </summary>
        public void LoadAssociatedAssets()
        {
            var charName = CharacterName.ToString();

            EmotionalAppraisalAsset ea = Loader(m_emotionalAppraisalAssetSource, () => new EmotionalAppraisalAsset());

            EmotionalDecisionMakingAsset edm = Loader(m_emotionalDecisionMakingAssetSource, () => new EmotionalDecisionMakingAsset());
            SocialImportanceAsset        si  = Loader(m_socialImportanceAssetSource, () => new SocialImportanceAsset());
            CommeillFautAsset            cfa = Loader(m_commeillFautAssetSource, () => new CommeillFautAsset());

            m_emotionalAppraisalAsset      = ea;
            m_emotionalDecisionMakingAsset = edm;
            m_socialImportanceAsset        = si;
            m_commeillFautAsset            = cfa;

            MCTSAsset mcts = new MCTSAsset();

            //Dynamic properties
            BindToRegistry(m_kb);
            edm.RegisterKnowledgeBase(m_kb);
            si.RegisterKnowledgeBase(m_kb);
            cfa.RegisterKnowledgeBase(m_kb);
            mcts.RegisterKnowledgeBase(m_kb);
            m_allowAuthoring = false;
        }
Exemplo n.º 3
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _currentFilePath = null;
     _storage         = new AssetStorage();
     _loadedAsset     = EmotionalDecisionMakingAsset.CreateInstance(_storage);
     OnAssetDataLoaded();
 }
Exemplo n.º 4
0
        public void Test_RPC_Decide()
        {
            var kb = new KB((Name)"Matt");

            var rpc = BuildEmotionalRPCAsset();

            var edm = new EmotionalDecisionMakingAsset();

            edm.AddActionRule(new ActionLibrary.DTOs.ActionRuleDTO()
            {
                Action = (Name)"EnterRoom", Priority = Name.BuildName(3), Target = (Name)"[x]", Conditions = new Conditions.DTOs.ConditionSetDTO()
                {
                    ConditionSet = new string[] { "[x]!=SELF" }
                }
            });

            rpc.m_emotionalDecisionMakingAsset = edm;

            edm.RegisterKnowledgeBase(rpc.m_kb);

            PopulateEventSet(1);

            foreach (var eve in eventSets[1])
            {
                rpc.Perceive((Name)eve);
                rpc.Update();
            }

            var actions = rpc.Decide();

            Assert.IsNotNull(actions);
        }
Exemplo n.º 5
0
        public AddOrEditReactionForm(EmotionalDecisionMakingAsset edmAsset, ActionRuleDTO reactionToEdit = null)
        {
            InitializeComponent();

            _edmAsset       = edmAsset;
            _reactionToEdit = reactionToEdit;

            textBoxAction.Value   = (WellFormedNames.Name) "A";
            textBoxPriority.Value = (WellFormedNames.Name) "1";

            //validators
            textBoxAction.AllowNil              = false;
            textBoxAction.AllowUniversal        = false;
            textBoxAction.AllowUniversalLiteral = false;
            textBoxTarget.AllowUniversal        = false;
            textBoxTarget.AllowComposedName     = false;
            textBoxPriority.OnlyIntOrVariable   = true;

            if (reactionToEdit != null)
            {
                this.Text = Resources.EditReactionFormTitle;
                this.addOrEditButton.Text = Resources.UpdateButtonLabel;
                textBoxAction.Value       = reactionToEdit.Action;
                textBoxTarget.Value       = reactionToEdit.Target;
                textBoxPriority.Value     = reactionToEdit.Priority;
                textBoxLayer.Value        = reactionToEdit.Layer;
            }
        }
        private EmotionalDecisionMakingAsset BuildTestAsset()
        {
            var asset = new EmotionalDecisionMakingAsset();

            asset.AddReaction(new ReactionDTO() {Action = "Speak([speachType])", Target = "[x]"});
            asset.AddReaction(new ReactionDTO() { Action = "Speak(formal)", Target = "[x]" });
            return asset;
        }
Exemplo n.º 7
0
 public MainForm()
 {
     InitializeComponent();
     this.actionRules = new BindingListView <ActionRuleDTO>((IList)null);
     dataGridViewReactiveActions.DataSource = this.actionRules;
     _storage     = new AssetStorage();
     _loadedAsset = EmotionalDecisionMakingAsset.CreateInstance(_storage);
     OnAssetDataLoaded();
 }
Exemplo n.º 8
0
        protected override void OnAssetDataLoaded(EmotionalDecisionMakingAsset asset)
        {
            _reactiveActions.DataSource = CurrentAsset.GetAllReactions().ToList();
            dataGridViewReactiveActions.Columns[PropertyUtil.GetPropertyName<ReactionDTO>(dto => dto.Id)].Visible = false;
            dataGridViewReactiveActions.Columns[PropertyUtil.GetPropertyName<ReactionDTO>(dto => dto.Conditions)].Visible = false;

            if (_reactiveActions.Any())
            {
                var ra = CurrentAsset.GetReaction(_reactiveActions.First().Id);
                UpdateConditions(ra);
            }
        }
        private EmotionalDecisionMakingAsset BuildTestAsset()
        {
            var asset = new EmotionalDecisionMakingAsset();

            asset.AddActionRule(new ActionRuleDTO()
            {
                Action = Name.BuildName("Speak([speachType])"), Target = Name.BuildName("[x]")
            });
            asset.AddActionRule(new ActionRuleDTO()
            {
                Action = Name.BuildName("Speak(formal)"), Target = Name.BuildName("[x]")
            });
            return(asset);
        }
Exemplo n.º 10
0
        internal ConfigStore(Platform platform = Platform.Windows)
        {
            Platform     = platform;
            ConfigValues = new Dictionary <ConfigKey, float>();
            var configText       = Templates.ResourceManager.GetString("config");
            var contractResolver = new PrivatePropertyResolver();
            var settings         = new JsonSerializerSettings
            {
                ContractResolver = contractResolver
            };

            ConfigValues = JsonConvert.DeserializeObject <Dictionary <ConfigKey, float> >(configText, settings);
            foreach (var key in (ConfigKey[])Enum.GetValues(typeof(ConfigKey)))
            {
                if (!ConfigValues.ContainsKey(key))
                {
                    throw new Exception("Config key " + key + " not included in config!");
                }
            }
            BoatTypes = new Dictionary <string, List <Position> >();
            var boatText = Templates.ResourceManager.GetString("boat_config");

            BoatTypes     = JsonConvert.DeserializeObject <Dictionary <string, List <Position> > >(boatText);
            GameConfig    = new GameConfig().GetConfig();
            NameConfig    = new NameConfig().GetConfig();
            Avatar.Config = new AvatarGeneratorConfig().GetConfig();

            AssetManager.Instance.Bridge = new TemplateBridge();
            RolePlayCharacter            = RolePlayCharacterAsset.LoadFromFile("template_rpc");
            EmotionalAppraisal           = EmotionalAppraisalAsset.LoadFromFile("template_ea");
            EmotionalDecisionMaking      = EmotionalDecisionMakingAsset.LoadFromFile("template_edm");
            SocialImportance             = SocialImportanceAsset.LoadFromFile("template_si");
            IntegratedAuthoringTool      = IntegratedAuthoringToolAsset.LoadFromFile("template_iat");

            switch (Platform)
            {
            case Platform.Android:
                AssetManager.Instance.Bridge = new AndroidBaseBridge();
                break;

            case Platform.iOS:
                AssetManager.Instance.Bridge = new IOSBaseBridge();
                break;

            case Platform.Windows:
                AssetManager.Instance.Bridge = new BaseBridge();
                break;
            }
        }
Exemplo n.º 11
0
        public void LoadAssociatedAssets(AssetStorage storage)
        {
            var charName = CharacterName.ToString();

            m_emotionalAppraisalAsset      = EmotionalAppraisalAsset.CreateInstance(storage);
            m_emotionalDecisionMakingAsset = EmotionalDecisionMakingAsset.CreateInstance(storage);
            m_socialImportanceAsset        = SocialImportanceAsset.CreateInstance(storage);
            m_commeillFautAsset            = CommeillFautAsset.CreateInstance(storage);

            //Dynamic properties
            BindToRegistry(m_kb);
            m_emotionalDecisionMakingAsset.RegisterKnowledgeBase(m_kb);
            m_commeillFautAsset.RegisterKnowledgeBase(m_kb);
            m_socialImportanceAsset.RegisterKnowledgeBase(m_kb);
        }
        public AddOrEditReactionForm(EmotionalDecisionMakingAsset edmAsset, ReactionDTO reactionToEdit = null)
        {
            InitializeComponent();

            _edmAsset = edmAsset;
            _reactionToEdit = reactionToEdit;

            if (reactionToEdit != null)
            {
                this.Text = Resources.EditReactionFormTitle;
                this.addOrEditButton.Text = Resources.UpdateButtonLabel;
                textBoxAction.Text = reactionToEdit.Action;
                textBoxTarget.Text = reactionToEdit.Target;
                textBoxPriority.Text = reactionToEdit.Priority.ToString();
            }
        }
Exemplo n.º 13
0
        //This is a small console program to exemplify the main functionality of the Emotional Decision Making Asset
        static void Main(string[] args)
        {
            //First we construct a new instance of the EmotionalDecisionMakingAsset class
            var edm = new EmotionalDecisionMakingAsset();

            //Then, we have to register an existing knowledge base to the asset so it can check for
            //beliefs are true
            var kb = new KB((Name)"John");

            kb.Tell((Name)"LikesToFight(SELF)", (Name)"True");
            edm.RegisterKnowledgeBase(kb);

            //create an action rule
            var actionRule = new ActionRuleDTO {
                Action = Name.BuildName("Kick"), Priority = Name.BuildName("4"), Target = (Name)"Player"
            };

            //add the reaction rule
            var id = edm.AddActionRule(actionRule);

            edm.AddRuleCondition(id, "LikesToFight(SELF) = True");
            var actions = edm.Decide(Name.UNIVERSAL_SYMBOL);

            Console.WriteLine("Decisions: ");
            foreach (var a in actions)
            {
                Console.WriteLine(a.Name.ToString() + " p: " + a.Utility);
            }

            //this is how you can load the asset from a file
            Console.WriteLine("Loading From File: ");
            edm = EmotionalDecisionMakingAsset.LoadFromFile("../../../Examples/EDM-Tutorial/EDMTest.edm");
            edm.RegisterKnowledgeBase(kb);
            actions = edm.Decide(Name.UNIVERSAL_SYMBOL);

            foreach (var a in actions)
            {
                Console.WriteLine(a.Name.ToString() + " p: " + a.Utility);
            }
            Console.WriteLine("Decisions: ");
            foreach (var a in actions)
            {
                Console.WriteLine(a.Name.ToString() + " p: " + a.Utility);
            }
            Console.ReadKey();
        }
Exemplo n.º 14
0
        private void buttonSetEmotionalDecisionMakingSource_Click(object sender, EventArgs e)
        {
            var ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    var edm = EmotionalDecisionMakingAsset.LoadFromFile(ofd.FileName);
                    _rpcAsset.EmotionalDecisionMakingSource   = ofd.FileName;
                    textBoxEmotionalDecisionMakingSource.Text = ofd.FileName;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + "-" + ex.StackTrace, Resources.ErrorDialogTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 15
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    _edmAsset     = EmotionalDecisionMakingAsset.LoadFromFile(ofd.FileName);
                    _saveFileName = ofd.FileName;
                    Reset(false);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + "-" + ex.StackTrace, Resources.ErrorDialogTitle, MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 16
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var aux = EditorTools.OpenFileDialog("Asset Storage File (*.json)|*.json|All Files|*.*");

            if (aux != null)
            {
                try
                {
                    _currentFilePath = aux;
                    _storage         = AssetStorage.FromJson(File.ReadAllText(_currentFilePath));
                    _loadedAsset     = EmotionalDecisionMakingAsset.CreateInstance(_storage);
                    OnAssetDataLoaded();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Exception: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 17
0
        private static RolePlayCharacterAsset BuildEmotionalRPCAsset()
        {
            var kb = new KB((Name)"Matt");


            var ea = new EmotionalAppraisalAsset();

            var appraisalRule = new EmotionalAppraisal.DTOs.AppraisalRuleDTO()
            {
                Conditions            = new Conditions.DTOs.ConditionSetDTO(),
                EventMatchingTemplate = (Name)"Event(*, *,*, *)",
                Desirability          = Name.BuildName(2),
                Praiseworthiness      = Name.BuildName(2)
            };

            ea.AddOrUpdateAppraisalRule(appraisalRule);


            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);
        }
Exemplo n.º 18
0
        public static RolePlayCharacterAsset LoadFromFile(string filename)
        {
            RolePlayCharacterAsset rpc;

            using (var f = File.Open(filename, FileMode.Open, FileAccess.Read))
            {
                var serializer = new JSONSerializer();
                rpc = serializer.Deserialize <RolePlayCharacterAsset>(f);
            }

            if (!string.IsNullOrEmpty(rpc.EmotionalAppraisalAssetSource))
            {
                try
                {
                    rpc._emotionalAppraisalAsset = EmotionalAppraisalAsset.LoadFromFile(rpc.EmotionalAppraisalAssetSource);
                }
                catch (Exception ex)
                {
                    rpc.ErrorOnLoad = "Unable to load the Emotional Appraisal Asset at " + rpc.EmotionalAppraisalAssetSource + ". Check if the path is correct.";
                    return(rpc);
                }

                if (!string.IsNullOrEmpty(rpc.EmotionalDecisionMakingSource))
                {
                    try
                    {
                        rpc._emotionalDecisionMakingAsset = EmotionalDecisionMakingAsset.LoadFromFile(rpc.EmotionalDecisionMakingSource);
                    }
                    catch (Exception ex)
                    {
                        rpc.ErrorOnLoad = "Unable to load the Emotional Decision Making Asset at " + rpc.EmotionalAppraisalAssetSource + ". Check if the path is correct.";
                        return(rpc);
                    }

                    rpc._emotionalDecisionMakingAsset.RegisterEmotionalAppraisalAsset(rpc._emotionalAppraisalAsset);
                }
            }
            return(rpc);
        }
Exemplo n.º 19
0
        protected override void OnAssetDataLoaded(EmotionalDecisionMakingAsset asset)
        {
            conditionSetView                = new ConditionSetView();
            conditionSetEditor.View         = conditionSetView;
            conditionSetView.OnDataChanged += conditionSetView_OnDataChanged;

            actionRules.DataSource = LoadedAsset.GetAllActionRules().ToList();

            dataGridViewReactiveActions.Columns[PropertyUtil.GetPropertyName <ActionRuleDTO>(dto => dto.Priority)].DisplayIndex = 3;

            EditorTools.HideColumns(dataGridViewReactiveActions, new[]
            {
                PropertyUtil.GetPropertyName <ActionRuleDTO>(d => d.Id),
                PropertyUtil.GetPropertyName <ActionRuleDTO>(d => d.Conditions)
            });


            if (actionRules.Any())
            {
                var ra = LoadedAsset.GetActionRule(actionRules.First().Id);
                UpdateConditions(ra);
            }
        }
Exemplo n.º 20
0
 public MainForm()
 {
     InitializeComponent();
     string[] args = Environment.GetCommandLineArgs();
     if (args.Length <= 1)
     {
         Reset(true);
     }
     else
     {
         _saveFileName = args[1];
         try
         {
             _edmAsset = EmotionalDecisionMakingAsset.LoadFromFile(_saveFileName);
             Reset(false);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, Resources.ErrorDialogTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
             Reset(true);
         }
     }
 }
Exemplo n.º 21
0
        protected override void OnAssetDataLoaded(RolePlayCharacterAsset asset)
        {
            textBoxCharacterName.Text  = asset.CharacterName == null ? string.Empty : asset.CharacterName.ToString();
            textBoxCharacterBody.Text  = asset.BodyName;
            textBoxCharacterVoice.Text = asset.VoiceName;

            _emotionalStateVM         = new EmotionalStateVM(this);
            _autobiographicalMemoryVM = new AutobiographicalMemoryVM(this);

            this.moodValueLabel.Text             = Math.Round(_emotionalStateVM.Mood).ToString(MOOD_FORMAT);
            this.moodTrackBar.Value              = (int)float.Parse(this.moodValueLabel.Text);
            this.StartTickField.Value            = _emotionalStateVM.Start;
            this.emotionsDataGridView.DataSource = _emotionalStateVM.Emotions;
            this.dataGridViewAM.DataSource       = _autobiographicalMemoryVM.Events;

            //EA ASSET
            if (string.IsNullOrEmpty(asset.EmotionalAppraisalAssetSource))
            {
                _eaForm.Hide();
            }
            else
            {
                this.pathTextBoxEA.Text = LoadableAsset <EmotionalDecisionMakingAsset> .ToRelativePath(LoadedAsset.AssetFilePath, asset.EmotionalAppraisalAssetSource);

                var ea = EmotionalAppraisalAsset.LoadFromFile(asset.EmotionalAppraisalAssetSource);
                _eaForm.LoadedAsset = ea;
                FormHelper.ShowFormInContainerControl(this.panelEA, _eaForm);
            }

            //EDM ASSET
            if (string.IsNullOrEmpty(asset.EmotionalDecisionMakingSource))
            {
                _edmForm.Hide();
            }
            else
            {
                this.textBoxPathEDM.Text = LoadableAsset <EmotionalDecisionMakingAsset> .ToRelativePath(LoadedAsset.AssetFilePath, asset.EmotionalDecisionMakingSource);

                var edm = EmotionalDecisionMakingAsset.LoadFromFile(asset.EmotionalDecisionMakingSource);
                _edmForm.LoadedAsset = edm;
                FormHelper.ShowFormInContainerControl(this.panelEDM, _edmForm);
            }

            //SI ASSET
            if (string.IsNullOrEmpty(asset.SocialImportanceAssetSource))
            {
                _siForm.Hide();
            }
            else
            {
                this.textBoxPathSI.Text = LoadableAsset <EmotionalDecisionMakingAsset> .ToRelativePath(LoadedAsset.AssetFilePath, asset.SocialImportanceAssetSource);

                var si = SocialImportanceAsset.LoadFromFile(asset.SocialImportanceAssetSource);
                _siForm.LoadedAsset = si;
                FormHelper.ShowFormInContainerControl(this.panelSI, _siForm);
            }

            //CIF ASSET
            if (string.IsNullOrEmpty(asset.CommeillFautAssetSource))
            {
                _cifForm.Hide();
            }
            else
            {
                this.textBoxPathCIF.Text = LoadableAsset <EmotionalDecisionMakingAsset> .ToRelativePath(LoadedAsset.AssetFilePath, asset.CommeillFautAssetSource);

                var cif = CommeillFautAsset.LoadFromFile(asset.CommeillFautAssetSource);
                _cifForm.LoadedAsset = cif;
                FormHelper.ShowFormInContainerControl(this.panelCIF, _cifForm);
            }

            //KB
            _knowledgeBaseVM = new KnowledgeBaseVM(this);
            dataGridViewBeliefs.DataSource = _knowledgeBaseVM.Beliefs;
        }
Exemplo n.º 22
0
        //This is a small console program to exemplify the main functionality of the Emotional Decision Making Asset
        static void Main(string[] args)
        {
            //First we construct a new instance of the EmotionalDecisionMakingAsset class
            var storage = new AssetStorage();
            var edm     = EmotionalDecisionMakingAsset.CreateInstance(storage);

            //Then, we have to register an existing knowledge base to the asset so it can check for
            //beliefs are true
            var kb = new KB((Name)"John");

            kb.Tell((Name)"LikesToFight(SELF)", (Name)"True");
            edm.RegisterKnowledgeBase(kb);
            //create an action rule
            var actionRule = new ActionRuleDTO {
                Action = Name.BuildName("Kick"), Priority = Name.BuildName("4"), Target = (Name)"Player"
            };


            //add the reaction rule
            var id   = edm.AddActionRule(actionRule);
            var rule = edm.GetActionRule(id);

            edm.AddRuleCondition(id, "LikesToFight(SELF) = True");
            var actions = edm.Decide(Name.UNIVERSAL_SYMBOL);
            var ea      = EmotionalAppraisalAsset.CreateInstance(storage);

            edm.Save();

            using (var writer = File.CreateText("D:\\test2.json"))
            {
                writer.Write(storage.ToJson());
            }

            string aux2 = File.ReadAllText("D:\\Test2.json");

            var storage2 = AssetStorage.FromJson(aux2);

            using (var writer = File.CreateText("D:\\test3.json"))
            {
                writer.Write(storage2.ToJson());
            }
            Console.WriteLine("Decisions: ");
            foreach (var a in actions)
            {
                Console.WriteLine(a.Name.ToString() + " p: " + a.Utility);
            }

            //this is how you can load the asset from a file
            Console.WriteLine("Loading From File: ");
            edm.RegisterKnowledgeBase(kb);
            actions = edm.Decide(Name.UNIVERSAL_SYMBOL);

            foreach (var a in actions)
            {
                Console.WriteLine(a.Name.ToString() + " p: " + a.Utility);
            }
            Console.WriteLine("Decisions: ");
            foreach (var a in actions)
            {
                Console.WriteLine(a.Name.ToString() + " p: " + a.Utility);
            }
            Console.ReadKey();
        }
Exemplo n.º 23
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);
        }