public List <GetUserInterests_Result> Interests([FromBody] CustomModels interest)

        {
            FRDBEntities db = new FRDBEntities();

            return(db.GetUserInterests(interest.email).ToList <GetUserInterests_Result>());
        }
Пример #2
0
        public ActionResult GetCustomPartial(CustomModels model)
        {
            switch (model)
            {
            case CustomModels.CompanyModel:
                var companyModel = new CompanyModel
                {
                    CurrentModel = CustomModels.CompanyModel,
                    CreatedBy    = "Anna",
                    CreatedDate  = DateTime.Now,
                    CompanyName  = "Bobs Building Company"
                };
                return(PartialView(companyModel));

            case CustomModels.UserModel:
                var userModel = new UserModel
                {
                    CurrentModel = CustomModels.UserModel,
                    CreatedBy    = "Ronald",
                    CreatedDate  = DateTime.Now,
                    Firstname    = "Sue"
                };
                return(PartialView(userModel));
            }

            return(Content("No such custom view."));
        }
        public List <GetUserSkills_Result> Skills([FromBody] CustomModels skill)

        {
            FRDBEntities db = new FRDBEntities();

            return(db.GetUserSkills(skill.email).ToList <GetUserSkills_Result>());
        }
        public GetUserInfo_Result UserProfile([FromBody] CustomModels userData)
        {
            FRDBEntities db = new FRDBEntities();

            using (db)
            {
                return(db.GetUserInfo(userData.email).FirstOrDefault <GetUserInfo_Result>());
            }
        }
        public List <String> Hobbies([FromBody] CustomModels hobby)

        {
            FRDBEntities db = new FRDBEntities();

            using (db)
            {
                return(db.GetUserHobbies(hobby.email).ToList <String>());
            }
        }
      public int SignUp([FromBody] CustomModels userData)
      {
          FRDBEntities db = new FRDBEntities();
          int          id = db.GetUserId(userData.email).FirstOrDefault <int?>() ?? default(int);;

          if (id.Equals(0))
          {
              return(db.UserSignUp(userData.email, userData.password, userData.firstName, userData.lastName, userData.percentage, userData.annualBudget, userData.location, userData.qualification));
          }
          return(0);
      }
        public GetUserInfo_Result EditProfile([FromBody] CustomModels userData)
        {
            FRDBEntities db  = new FRDBEntities();
            FRDBEntities db1 = new FRDBEntities();

            using (db)
            {
                db.UpdateUserInfo(userData.email, userData.firstName, userData.lastName, userData.percentage, userData.annualBudget, userData.location, userData.qualification);
            }


            return(db1.GetUserInfo(userData.email).FirstOrDefault <GetUserInfo_Result>());
        }
Пример #8
0
    void Start()
    {
        base.Start();
        this.name = new Phrase(Expression.BLAIR);

        CustomModels.AddVillageModel(this.model);

        // ACTION RULES

        // Substitution Rules

        // particular beliefs
        model.Add(new Phrase(Expression.IDENTITY, Expression.SELF, Expression.BLAIR));
    }
Пример #9
0
    void Start()
    {
        base.Start();
        this.name = new Word(SemanticType.INDIVIDUAL, "kevin");
        CustomModels.AddWoodcutterModel(this.model);
        // SUBSTITUTION RULES

        // ACTION RULES

        // PARTICULAR BELIEFS
        model.Add(new Phrase(Expression.IDENTITY, Expression.SELF, new Phrase(Expression.THE, Expression.KING)));
        model.Add(new Phrase(Expression.POSSESS, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.REAL, Expression.CROWN))));
        // SELF-KNOWLEDGE
    }
Пример #10
0
    void Start()
    {
        base.Start();

        this.name = new Word(SemanticType.INDIVIDUAL, "the_jester");

        CustomModels.AddWoodcutterModel(this.model);
        // Substitution Rules

        // Action Rules
        model.Add(new ActionRule(
                      new Phrase(Expression.POSSESS, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN))),
                      new Phrase(Expression.WOULD, new Phrase(Expression.WEAR, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN)))),
                      new Phrase(Expression.WEAR, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN)))));

        model.Add(new ActionRule(
                      new Phrase(Expression.POSSESS, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN))),
                      new Phrase(Expression.WOULD, new Phrase(Expression.NOT, new Phrase(Expression.WEAR, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN))))),
                      new Phrase(Expression.NOT, new Phrase(Expression.WEAR, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN))))));

        model.Add(new ActionRule(
                      new ExpressionPattern(Expression.AND,
                                            new ExpressionPattern(Expression.AT, Expression.SELF, new MetaVariable(SemanticType.INDIVIDUAL, 0)),
                                            new Phrase(Expression.POSSESS, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN)))),
                      new ExpressionPattern(Expression.WOULD,
                                            new ExpressionPattern(Expression.POSSESS,
                                                                  new MetaVariable(SemanticType.INDIVIDUAL, 0),
                                                                  new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN)))),
                      new ExpressionPattern(Expression.POSSESS,
                                            new MetaVariable(SemanticType.INDIVIDUAL, 0),
                                            new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN)))));

        // particular beliefs
        model.Add(new Phrase(Expression.PERCEIVE, Expression.SELF, new Phrase(Expression.POSSESS, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN)))));
        model.Add(new Phrase(Expression.MAKE, Expression.SELF, new Phrase(Expression.NOT, new Phrase(Expression.WEAR, Expression.SELF, new Phrase(Expression.THE, new Phrase(Expression.FAKE, Expression.CROWN))))));

        // model.Add(new Phrase(Expression.IDENTITY, Expression.SELF, new Phrase(Expression.THE, Expression.KING)));
        // self-knowledge
    }
        public IEnumerator TestListCustomModels()
        {
            Log.Debug("TextToSpeechServiceV1IntegrationTests", "Attempting to ListCustomModels...");
            CustomModels listCustomModelsResponse = null;

            service.ListCustomModels(
                callback: (DetailedResponse <CustomModels> response, IBMError error) =>
            {
                Log.Debug("TextToSpeechServiceV1IntegrationTests", "ListCustomModels result: {0}", response.Response);
                listCustomModelsResponse = response.Result;
                Assert.IsNotNull(listCustomModelsResponse);
                Assert.IsNotNull(listCustomModelsResponse.Customizations);
                Assert.IsTrue(listCustomModelsResponse.Customizations.Count > 0);
                Assert.IsNull(error);
            },
                language: customModelLanguage
                );

            while (listCustomModelsResponse == null)
            {
                yield return(null);
            }
        }
Пример #12
0
    void Start()
    {
        base.Start();
        this.name = new Phrase(Expression.THE, new Phrase(Expression.POSSESS, new Phrase(Expression.THE, Expression.LOG), 1));

        CustomModels.AddWoodcutterModel(this.model);

        // ACTION RULES
        this.model.Add(new ActionRule(
                           new Phrase(Expression.AT, Expression.SELF, new Phrase(Expression.THE, Expression.TREE)),
                           new Phrase(Expression.WOULD, new Phrase(Expression.EXISTS, new Phrase(Expression.THE, Expression.LOG))),
                           new Phrase(Expression.EXISTS, new Phrase(Expression.THE, Expression.LOG))));

        // Substitution Rules

        // x has the crown |- x is king
        this.model.Add(new SubstitutionRule(
                           new List <IPattern>[] { DefaultModel.BuildList(new ExpressionPattern(Expression.POSSESS, new MetaVariable(SemanticType.INDIVIDUAL, 0), new Phrase(Expression.THE, Expression.CROWN))) },
                           new List <IPattern>[] { DefaultModel.BuildList(new ExpressionPattern(Expression.KING, new MetaVariable(SemanticType.INDIVIDUAL, 0))) }));

        // particular beliefs

        // self-knowledge
    }
Пример #13
0
        public CustomModels CreateModel(CreateModelOptions _options)
        {
            CustomModels result = null;

            if (string.IsNullOrEmpty(_options.BaseModelId))
            {
                throw new ArgumentNullException($"Argument is not valid: {nameof(_options.BaseModelId)}");
            }

            if (_options.Name.Contains(" "))
            {
                throw new ArgumentException($"Argument is not valid (No spaces): {nameof(_options.Name)}");
            }

            if (_options.ForcedGlossary == null && _options.ParallelCorpus == null && _options.MonolingualCorpus == null)
            {
                throw new ArgumentNullException($"Glossary or Corpus file is not valid");
            }

            double fileSize = _options.ForcedGlossary != null ? (_options.ForcedGlossary.Length) / Math.Pow(1024, 2) : 0;

            fileSize += _options.ParallelCorpus != null ? (_options.ParallelCorpus.Length) / Math.Pow(1024, 2) : 0;
            fileSize += _options.MonolingualCorpus != null ? (_options.MonolingualCorpus.Length) / Math.Pow(1024, 2) : 0;

            if (fileSize > 250)
            {
                throw new Exception("The cumulative file size of all uploaded glossary and corpus files is limited to 250 MB.");
            }

            try
            {
                var formData = new MultipartFormDataContent();

                if (_options.ForcedGlossary != null)
                {
                    var forcedGlossaryContent = new ByteArrayContent((_options.ForcedGlossary as Stream).ReadAllBytes());
                    forcedGlossaryContent.Headers.ContentType = MediaTypeHeaderValue.Parse("text/xml");
                    formData.Add(forcedGlossaryContent, "forced_glossary", _options.ForcedGlossary.Name);
                }

                if (_options.ParallelCorpus != null)
                {
                    var parallelCorpusContent = new ByteArrayContent((_options.ParallelCorpus as Stream).ReadAllBytes());
                    parallelCorpusContent.Headers.ContentType = MediaTypeHeaderValue.Parse("text/xml");
                    formData.Add(parallelCorpusContent, "forced_glossary", _options.ParallelCorpus.Name);
                }

                if (_options.MonolingualCorpus != null)
                {
                    var monolingualCorpusContent = new ByteArrayContent((_options.MonolingualCorpus as Stream).ReadAllBytes());
                    monolingualCorpusContent.Headers.ContentType = MediaTypeHeaderValue.Parse("text/xml");
                    formData.Add(monolingualCorpusContent, "forced_glossary", _options.MonolingualCorpus.Name);
                }

                result =
                    this.Client.WithAuthentication(this.UserName, this.Password)
                    .PostAsync($"{this.Endpoint}{PATH_MODEL}")
                    .WithArgument("base_model_id", _options.BaseModelId)
                    .WithArgument("name", _options.Name)
                    .WithBodyContent(formData)
                    .As <CustomModels>()
                    .Result;
            }
            catch (AggregateException ae)
            {
                throw ae.Flatten();
            }

            return(result);
        }
        public PersonStatistics(string sessionId, int numberOfSamplesToTake, int ageQuants, int?ageQuantLevel) : base(sessionId, numberOfSamplesToTake, ageQuants, ageQuantLevel)
        {
            RelationshipStatistics  = new RelationshipStatistics(numberOfSamplesToTake);
            SivilstatusStatistics   = new SivilstatusStatistics(numberOfSamplesToTake);
            NameStatistics          = ageQuantLevel.HasValue ? null : new NameStatistics(numberOfSamplesToTake);
            RegstatusStatistics     = new RegstatusStatistics(numberOfSamplesToTake);
            AdressStatistics        = ageQuantLevel.HasValue ? null : new AdressStatistics(numberOfSamplesToTake);
            RegStatus_Vs_PostalType = new DependentDiscreteStatistic(numberOfSamplesToTake, "RegStatus_Vs_PostalType", (p, a) => new Tuple <double?, double?>(p.RegStatus, AdressStatistics.GetCurrent(p.Addresses)?.PostalType));

            CustomModels.Add("RelationshipStatistics", RelationshipStatistics);
            CustomModels.Add("SivilstatusStatistics", SivilstatusStatistics);
            CustomModels.Add("NameStatistics", NameStatistics);
            CustomModels.Add("RegstatusStatistics", RegstatusStatistics);
            CustomModels.Add("AdressStatistics", AdressStatistics);
            CustomModels.Add("RegStatus_Vs_PostalType", RegStatus_Vs_PostalType);

            Kjonn = new DiscreteStatistic(numberOfSamplesToTake, "Kjonn", CorrelationFactory, (p, a) =>
            {
                if (NinModel.IsValidNin(p.NIN) && !CommonFunctions.HasDnummer(p.NIN))
                {
                    return(CommonFunctions.GetKjonn(p.NIN).Value);
                }

                return(Statistic.DontUpdateWhenThisValue);
            });

            HasDnummer_Kjonn = new DiscreteStatistic(numberOfSamplesToTake, "HasDnummer_Kjonn", CorrelationFactory,
                                                     (p, a) =>
            {
                if (NinModel.IsValidNin(p.NIN) && CommonFunctions.HasDnummer(p.NIN))
                {
                    return(CommonFunctions.GetKjonn(p.NIN).Value);
                }

                return(Statistic.DontUpdateWhenThisValue);
            });

            HasDnummer = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasDnummer, CorrelationFactory, (p, a) =>
            {
                if (NinModel.IsValidNin(p.NIN))
                {
                    return(CommonFunctions.HasDnummer(p.NIN) ? 1 : 0);
                }

                return(Statistic.DontUpdateWhenThisValue);
            });

            Age = new Statistic(numberOfSamplesToTake, PersonStatisticKeys.Age, CorrelationFactory, (p, a) => p.DateOfBirth.HasValue? CommonFunctions.GetAge(p.DateOfBirth.Value).GetValue() : null);

            IsDead                = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsDead, CorrelationFactory, (p, a) => IsPersonDead(p));
            IsUkjent              = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsUkjent, CorrelationFactory, (p, a) => HasUkjentRegCode(p));           //-1000
            IsBosatt              = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsBosatt, CorrelationFactory, (p, a) => HasRegcode(p, 1));              //1
            IsUtflyttet           = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsUtflyttet, CorrelationFactory, (p, a) => HasRegcode(p, 2));           //2
            IsUtvandret           = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsUtvandret, CorrelationFactory, (p, a) => HasRegcode(p, 3));           //3
            IsForsvunnet          = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsForsvunnet, CorrelationFactory, (p, a) => HasRegcode(p, 4));          //4
            IsUtgaatFodselsnummer = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsUtgaatFodselsnummer, CorrelationFactory, (p, a) => HasRegcode(p, 6)); //6
            IsFodselsregistrert   = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsFodselsregistrert, CorrelationFactory, (p, a) => HasRegcode(p, 7));   //7
            IsAnnullertTilgang    = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsAnnullertTilgang, CorrelationFactory, (p, a) => HasRegcode(p, 8));    //8
            IsUregistrertTilgang  = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.IsUregistrertTilgang, CorrelationFactory, (p, a) => HasRegcode(p, 9));  //9

            HasFirstname = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasFirstname, CorrelationFactory, (p, a) => string.IsNullOrEmpty(p.GivenName) || string.IsNullOrWhiteSpace(p.GivenName) ? 0 : 1);
            HasLastname  = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasLastname, CorrelationFactory, (p, a) => string.IsNullOrEmpty(p.Sn) || string.IsNullOrWhiteSpace(p.Sn) ? 0 : 1);

            HasFather = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasFather, CorrelationFactory, (p, a) => String.IsNullOrEmpty(p.FathersNIN) ? 0 : 1);
            HasMother = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasMother, CorrelationFactory, (p, a) => String.IsNullOrEmpty(p.MothersNIN) ? 0 : 1);
            HasSpouse = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasSpouse, CorrelationFactory, (p, a) => String.IsNullOrEmpty(p.SpouseNIN) ? 0 : 1);
            Citizenship_And_CitizenshipCode = new DiscreteStringStatistics(numberOfSamplesToTake, ageQuantLevel, PersonStatisticKeys.Citizenship_And_CitizenshipCode, CorrelationFactory, (p, a) => (string.IsNullOrEmpty(p.Citizenship) ? "null" : p.Citizenship) + "_" + (string.IsNullOrEmpty(p.CitizenshipCode) ? "null" : p.CitizenshipCode));
            HasCitizenship          = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasCitizenship, CorrelationFactory, (p, a) => string.IsNullOrEmpty(p.Citizenship) ? 0 : 1);
            Custody                 = new DiscreteStringStatistics(numberOfSamplesToTake, ageQuantLevel, PersonStatisticKeys.Custody, CorrelationFactory, (p, a) => p.Custody);
            HasCustody              = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasCustody, CorrelationFactory, (p, a) => string.IsNullOrEmpty(p.Custody) ? 0 : 1);
            WithoutLegalCapacity    = new DiscreteStringStatistics(numberOfSamplesToTake, ageQuantLevel, PersonStatisticKeys.WithoutLegalCapacity, CorrelationFactory, (p, a) => p.WithoutLegalCapacity);
            HasWithoutLegalCapacity = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasWithoutLegalCapacity, CorrelationFactory, (p, a) => string.IsNullOrEmpty(p.WithoutLegalCapacity) ? 0 : 1);
            HasValidNin             = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasValidNin, CorrelationFactory, (p, a) => NinModel.IsValidNin(p.NIN) ? 1 : 0);
            HasDufNo                = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasDufNo, CorrelationFactory, (p, a) => string.IsNullOrEmpty(p.DufNo) ? 0 : 1);
            MaritalStatus           = new DiscreteStatistic(numberOfSamplesToTake, PersonStatisticKeys.MaritalStatus, CorrelationFactory, (p, a) => p.MaritalStatus.GetValue());
            HasOldNIN               = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasOldNIN, CorrelationFactory, (p, a) => string.IsNullOrEmpty(p.OldNIN) ? 0 : 1);
            HasNewNIN               = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasNewNIN, CorrelationFactory, (p, a) => string.IsNullOrEmpty(p.NewNIN) ? 0 : 1);
            ParentalResponsibility  = new DiscreteStatistic(numberOfSamplesToTake, PersonStatisticKeys.ParentalResponsibility, CorrelationFactory, (p, a) => p.ParentalResponsibility.GetValue());
            RegStatus               = new DiscreteStatistic(numberOfSamplesToTake, PersonStatisticKeys.RegStatus, CorrelationFactory, (p, a) => p.RegStatus.GetValue());
            StatusCountryCode       = new DiscreteStatistic(numberOfSamplesToTake, PersonStatisticKeys.StatusCountryCode, CorrelationFactory, (p, a) => p.StatusCountryCode);
            HasStatusCountryCode    = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasStatusCountryCode, CorrelationFactory, (p, a) => p.StatusCountryCode.HasValue ? 1 : 0);
            WorkPermit              = new DiscreteStringStatistics(numberOfSamplesToTake, ageQuantLevel, PersonStatisticKeys.WorkPermit, CorrelationFactory, (p, a) => p.WorkPermit);
            HasWorkPermit           = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasWorkPermit, CorrelationFactory, (p, a) => string.IsNullOrEmpty(p.WorkPermit) ? 0 : 1);
            PostalCode              = new DiscreteStringStatistics(numberOfSamplesToTake, ageQuantLevel, PersonStatisticKeys.PostalCode, CorrelationFactory, (p, a) => p.Addresses != null && p.Addresses.Any() ? p.Addresses.First().PostalCode : null);
            HasPostalCode           = new BooleanStatistic(numberOfSamplesToTake, PersonStatisticKeys.HasPostalCode, CorrelationFactory, (p, aa) => p.Addresses != null && p.Addresses.Any(a => a.CurrentAddress && !string.IsNullOrEmpty(a.PostalCode)) ? 1 : 0);

            DateWorkPermit             = new DateStatistics(numberOfSamplesToTake, PersonStatisticKeys.DateWorkPermit, CorrelationFactory, (p, a) => new Tuple <string, DateTime?, DateTime?>(p.WorkPermit, p.DateWorkPermit, p.DateOfBirth));
            DateParentalResponsibility = new DateStatistics(numberOfSamplesToTake, PersonStatisticKeys.DateParentalResponsibility, CorrelationFactory, (p, a) => new Tuple <string, DateTime?, DateTime?>(p.ParentalResponsibility?.ToString(), p.DateParentalResponsibility, p.DateOfBirth));
            DateWithoutLegalCapacity   = new DateStatistics(numberOfSamplesToTake, PersonStatisticKeys.DateWithoutLegalCapacity, CorrelationFactory, (p, a) => new Tuple <string, DateTime?, DateTime?>(p.WithoutLegalCapacity, p.DateWithoutLegalCapacity, p.DateOfBirth));
            DateCustody     = new DateStatistics(numberOfSamplesToTake, PersonStatisticKeys.DateCustody, CorrelationFactory, (p, a) => new Tuple <string, DateTime?, DateTime?>(p.Custody, p.DateCustody, p.DateOfBirth));
            DateCitizenship = new DateStatistics(numberOfSamplesToTake, PersonStatisticKeys.DateCitizenship, CorrelationFactory, (p, a) => new Tuple <string, DateTime?, DateTime?>(p.Citizenship, p.DateCitizenship, p.DateOfBirth));

            AddEntitiesToBaseDictionary <BooleanStatistic>();
            AddEntitiesToBaseDictionary <DiscreteStringStatistics>();
            AddEntitiesToBaseDictionary <DiscreteStatistic>();
            AddEntitiesToBaseDictionary <DateStatistics>();

            Statistics.Add(Age.Name, Age);
        }
Пример #15
0
    void Start()
    {
        base.Start();
        CustomModels.AddFPExperimentModel(this.model);

        this.name = Expression.EVAN;

        // CustomModels.AddDoorModel(this.model);
        // Substitution Rules

        model.Add(
            new Phrase(Expression.ABLE,
                       Expression.SELF,
                       new Phrase(Expression.AT, Expression.SELF, Expression.BOB)));

        model.Add(
            new Phrase(Expression.ABLE,
                       Expression.SELF,
                       new Phrase(Expression.AT, Expression.SELF, new Phrase(Expression.THE, Expression.DOOR))));

        model.Add(new Phrase(Expression.IF,
                             new Phrase(Expression.AT, Expression.SELF, new Phrase(Expression.THE, Expression.DOOR)),
                             new Phrase(Expression.ABLE, Expression.SELF, new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR)))));

        model.Add(new Phrase(Expression.IF,
                             new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR)),
                             new Phrase(Expression.ABLE, Expression.SELF, new Phrase(Expression.AT, Expression.SELF, Expression.GOAL))));

        // Action Rules
        // model.Add(new ActionRule(
        //     new Phrase(Expression.AT, Expression.SELF, new Phrase(Expression.THE, Expression.DOOR)),
        //     new Phrase(Expression.WOULD, new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR))),
        //     new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR))));

        // model.Add(new ActionRule(
        //     new Phrase(Expression.AT, Expression.SELF, new Phrase(Expression.THE, Expression.DOOR)),
        //     new Phrase(Expression.WOULD, new Phrase(Expression.CLOSED, new Phrase(Expression.THE, Expression.DOOR))),
        //     new Phrase(Expression.CLOSED, new Phrase(Expression.THE, Expression.DOOR))));

        // // particular beliefs

        // // self-knowledge
        // model.Add(new Phrase(Expression.IDENTITY, Expression.SELF, Expression.EVAN));
        // model.Add(new Phrase(Expression.KING, Expression.SELF));
        // // model.Add(new Phrase(Expression.NOT, new Phrase(Expression.IDENTITY, Expression.BOB, Expression.EVAN)));

        // // beliefs about Bob
        // // model.Add(new Phrase(Expression.PERSON, Expression.BOB));
        // // model.Add(new Phrase(Expression.ACTIVE, Expression.BOB));
        // // model.Add(new Phrase(Expression.BELIEVE, Expression.BOB, new Phrase(Expression.KING, Expression.BOB)));

        // // // // // utilities
        // model.SetUtility(new Phrase(Expression.AT, Expression.SELF, Expression.GOAL), 5f);
        // model.SetUtility(new Phrase(Expression.AT, Expression.SELF, Expression.BOB), 2f);

        // model.Add(new Phrase(Expression.BETTER,
        //     new Phrase(Expression.AT, Expression.SELF, Expression.BOB),
        //     Expression.NEUTRAL));

        // model.Add(new Phrase(Expression.BETTER,
        //     new Phrase(Expression.AT, Expression.SELF, Expression.GOAL),
        //     new Phrase(Expression.AT, Expression.SELF, Expression.BOB)));
    }
Пример #16
0
    void Start()
    {
        base.Start();
        CustomModels.AddFPExperimentModel(this.model);
        this.name = Expression.BOB;

        if (GameObject.Find("GameController").GetComponent <GameController>().is2D)
        {
            CustomModels.AddDoorModel(this.model);
        }
        else
        {
            CustomModels.AddFPExperimentModel(this.model);
        }

        MetaVariable xi0 = new MetaVariable(SemanticType.INDIVIDUAL, 0);
        MetaVariable xi1 = new MetaVariable(SemanticType.INDIVIDUAL, 1);

        // model.Add(new ActionRule(
        //     Expression.VERUM,
        //     new ExpressionPattern(Expression.WOULD, new ExpressionPattern(Expression.POSSESS, xi0, Expression.RUBY)),
        //     new ExpressionPattern(Expression.POSSESS, xi0, Expression.RUBY)));

        // model.Add(new ActionRule(
        //     new Phrase(Expression.AT, Expression.SELF, Expression.EVAN),
        //     new Phrase(Expression.WOULD,
        //         new Phrase(Expression.INTEND, Expression.EVAN,
        //             new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR)))),
        //     new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR))));

        // model.Add(new ActionRule(
        //     new Phrase(Expression.AT, Expression.SELF, Expression.EVAN),
        //     new Phrase(Expression.WOULD,
        //         new Phrase(Expression.INTEND, Expression.EVAN,
        //             new Phrase(Expression.CLOSED, new Phrase(Expression.THE, Expression.DOOR)))),
        //     new Phrase(Expression.CLOSED, new Phrase(Expression.THE, Expression.DOOR))));

        // // self-knowledge
        // model.Add(new Phrase(Expression.IDENTITY, Expression.SELF, Expression.BOB));
        // model.Add(new Phrase(Expression.KING, Expression.SELF));
        // model.Add(new Phrase(Expression.POSSESS, Expression.SELF, Expression.RUBY));
        // model.Add(new Phrase(Expression.NOT, new Phrase(Expression.POSSESS, Expression.SELF, Expression.SAPPHIRE)));
        // model.Add(new Phrase(Expression.NOT, new Phrase(Expression.POSSESS, Expression.SELF, Expression.EMERALD)));
        // // model.Add(new Phrase(Expression.NOT, new Phrase(Expression.IDENTITY, Expression.BOB, Expression.EVAN)));

        // beliefs about Evan
        model.Add(new Phrase(Expression.PERSON, Expression.EVAN));
        model.Add(new Phrase(Expression.ABLE, Expression.EVAN, new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR))));
        model.Add(new Phrase(Expression.INDIFFERENT, Expression.EVAN, new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR)), Expression.NEUTRAL));
        // model.Add(new Phrase(Expression.ACTIVE, Expression.EVAN));
        // // model.Add(new Phrase(Expression.BELIEVE, Expression.EVAN, new Phrase(new Phrase(Expression.KING, Expression.BOB))));
        // // model.Add(new Phrase(Expression.BELIEVE, Expression.EVAN, new Phrase(Expression.KING, Expression.EVAN)));

        model.Add(new Phrase(Expression.IN_THE_ROOM, Expression.SELF));
        model.Add(new Phrase(Expression.POSSESS, Expression.SELF, Expression.RUBY));
        model.Add(new Phrase(Expression.BETTER,
                             new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR)),
                             Expression.NEUTRAL));

        model.Add(new Phrase(Expression.ABLE, Expression.SELF, new Phrase(Expression.AT, Expression.SELF, Expression.EVAN)));

        model.Add(new Phrase(Expression.IF,
                             new Phrase(Expression.AT, Expression.SELF, Expression.EVAN),
                             new Phrase(Expression.ABLE, Expression.SELF,
                                        new Phrase(Expression.EXPRESS_CONFORMITY, Expression.SELF, Expression.EVAN,
                                                   new Phrase(Expression.WOULD, new Phrase(Expression.OPEN, new Phrase(Expression.THE, Expression.DOOR)))))));

        // // // utilities
        // model.Add(new Phrase(Expression.BETTER,
        //     new Phrase(Expression.POSSESS, Expression.SELF, Expression.EMERALD), Expression.NEUTRAL));

        // model.Add(new Phrase(Expression.BETTER,
        //     new Phrase(Expression.POSSESS, Expression.EVAN, Expression.RUBY), Expression.NEUTRAL));

        // model.SetUtility(new Phrase(Expression.POSSESS, Expression.SELF, Expression.EMERALD), 10f);
    }