public static ActionEntry MakeActionEntry([NotNull] TimeStep timeStep, StrGuid personGuid,
                                                  [NotNull] string personName,
                                                  bool isSick, [NotNull] string affordanceName,
                                                  StrGuid affordanceGuid, [NotNull] HouseholdKey householdKey,
                                                  [NotNull] string category,
                                                  DateTime timestamp, BodilyActivityLevel bodilyActivityLevel)
        {
            ActionEntry ae = new ActionEntry(
                category, householdKey, timeStep, timestamp,
                personGuid, personName, isSick, affordanceName,
                affordanceGuid,
                0, bodilyActivityLevel);

            return(ae);
        }
 public ActionEntry([NotNull] string category, [NotNull] HouseholdKey householdKey, [NotNull] TimeStep timeStep,
                    DateTime dateTime, StrGuid personGuid, [NotNull] string personName, bool isSick,
                    [NotNull] string affordanceName, StrGuid affordanceGuid, int id, BodilyActivityLevel bodilyActivityLevel)
 {
     Category            = category;
     HouseholdKey        = householdKey;
     TimeStep            = timeStep;
     DateTime            = dateTime;
     PersonGuid          = personGuid;
     PersonName          = personName;
     IsSick              = isSick;
     AffordanceName      = affordanceName;
     AffordanceGuid      = affordanceGuid;
     ID                  = id;
     BodilyActivityLevel = bodilyActivityLevel;
     ActionEntryGuid     = Guid.NewGuid().ToStrGuid();
 }
Ejemplo n.º 3
0
 public CalcAffordanceDto([NotNull] string name, int id, [NotNull] CalcProfileDto personProfile, [NotNull] string calcLocationName,
                          StrGuid calcLocationGuid, bool randomEffect,
                          [ItemNotNull][NotNull] List <CalcDesireDto> satisfactionvalues, int miniumAge, int maximumAge,
                          PermittedGender permittedGender,
                          bool needsLight, double timeStandardDeviation, byte colorR, byte colorG, byte colorB, [NotNull] string affCategory,
                          bool isInterruptable, bool isInterrupting, [ItemNotNull][NotNull] List <CalcAffordanceVariableOpDto> variableOps,
                          [ItemNotNull][NotNull] List <VariableRequirementDto> variableRequirements,
                          ActionAfterInterruption actionAfterInterruption, [NotNull] string timeLimitName, int weight,
                          bool requireAllDesires, [NotNull] string srcTrait,
                          StrGuid guid, [NotNull] AvailabilityDataReferenceDto isBusyArray,
                          [NotNull] HouseholdKey householdKey, BodilyActivityLevel bodilyActivityLevel)
 {
     Name                    = name;
     ID                      = id;
     PersonProfile           = personProfile;
     CalcLocationName        = calcLocationName;
     CalcLocationGuid        = calcLocationGuid;
     RandomEffect            = randomEffect;
     Satisfactionvalues      = satisfactionvalues;
     MiniumAge               = miniumAge;
     MaximumAge              = maximumAge;
     PermittedGender         = permittedGender;
     NeedsLight              = needsLight;
     TimeStandardDeviation   = timeStandardDeviation;
     ColorR                  = colorR;
     ColorG                  = colorG;
     ColorB                  = colorB;
     AffCategory             = affCategory;
     IsInterruptable         = isInterruptable;
     IsInterrupting          = isInterrupting;
     VariableOps             = variableOps;
     VariableRequirements    = variableRequirements;
     ActionAfterInterruption = actionAfterInterruption;
     TimeLimitName           = timeLimitName;
     Weight                  = weight;
     RequireAllDesires       = requireAllDesires;
     SrcTrait                = srcTrait;
     Guid                    = guid;
     IsBusyArray             = isBusyArray;
     HouseholdKey            = householdKey;
     BodilyActivityLevel     = bodilyActivityLevel;
 }
Ejemplo n.º 4
0
        protected CalcAffordanceBase([NotNull] string pName, [NotNull] CalcLocation loc,
                                     [NotNull][ItemNotNull] List <CalcDesire> satisfactionvalues,
                                     int miniumAge, int maximumAge, PermittedGender permittedGender, bool needsLight,
                                     bool randomEffect,
                                     [NotNull] string pAffCategory, bool isInterruptable, bool isInterrupting,
                                     ActionAfterInterruption actionAfterInterruption, int weight,
                                     bool requireAllAffordances,
                                     CalcAffordanceType calcAffordanceType,
                                     StrGuid guid,
                                     [ItemNotNull][NotNull] BitArray isBusyArray,
                                     BodilyActivityLevel bodilyActivityLevel, [NotNull] CalcRepo calcRepo,
                                     [CanBeNull] CalcSite site = null) : base(pName, guid)
        {
            CalcAffordanceType  = calcAffordanceType;
            BodilyActivityLevel = bodilyActivityLevel;
            CalcRepo            = calcRepo;
            Site               = site;
            ParentLocation     = loc;
            Satisfactionvalues = satisfactionvalues;
            _isBusyArray       = new BitArray(calcRepo.CalcParameters.InternalTimesteps);
            //copy to make sure that it is a separate instance
            for (var i = 0; i < isBusyArray.Length; i++)
            {
                _isBusyArray[i] = isBusyArray[i];
            }
            Weight = weight;
            RequireAllAffordances    = requireAllAffordances;
            MiniumAge                = miniumAge;
            MaximumAge               = maximumAge;
            PermittedGender          = permittedGender;
            NeedsLight               = needsLight;
            RandomEffect             = randomEffect;
            AffCategory              = pAffCategory;
            IsInterruptable          = isInterruptable;
            IsInterrupting           = isInterrupting;
            _actionAfterInterruption = actionAfterInterruption;
            CalcAffordanceSerial     = _calcAffordanceBaseSerialTracker;
#pragma warning disable S3010 // Static fields should not be updated in constructors
            _calcAffordanceBaseSerialTracker++;
#pragma warning restore S3010 // Static fields should not be updated in constructors
        }
 public CalcSubAffordance([NotNull] string pName, [NotNull] CalcLocation loc, [NotNull][ItemNotNull] List <CalcDesire> satisfactionvalues,
                          int miniumAge, int maximumAge, int delaytimesteps, PermittedGender permittedGender, [NotNull] string pAffCategory,
                          bool isInterruptable, bool isInterrupting, [NotNull] CalcAffordance parentAffordance,
                          [NotNull][ItemNotNull] List <CalcAffordanceVariableOp> variableOps, int weight,
                          [NotNull] string sourceTrait,
                          StrGuid guid, [ItemNotNull][NotNull] BitArray isBusy,
                          [NotNull] CalcVariableRepository repository, BodilyActivityLevel bodilyActivityLevel, [NotNull] CalcRepo calcRepo)
     : base(
         pName, loc, satisfactionvalues, miniumAge, maximumAge, permittedGender, false, false, pAffCategory,
         isInterruptable, isInterrupting, ActionAfterInterruption.GoBackToOld, weight, false,
         CalcAffordanceType.Subaffordance, guid, isBusy, bodilyActivityLevel, calcRepo)
 {
     Delaytimesteps   = delaytimesteps;
     _variableOps     = variableOps;
     _repository      = repository;
     SubAffordances   = new List <CalcSubAffordance>();
     Energyprofiles   = new List <CalcAffordance.DeviceEnergyProfileTuple>();
     AffordanceColor  = LPGColors.Black;
     SourceTrait      = sourceTrait;
     TimeLimitName    = null;
     ParentAffordance = parentAffordance;
 }
        public void AddActionEntry(TimeStep timeStep, StrGuid personGuid, string personName,
                                   bool isSick, string affordanceName, StrGuid affordanceGuid,
                                   HouseholdKey householdKey, string affordanceCategory, BodilyActivityLevel bodilyActivityLevel)
        {
            if (!timeStep.DisplayThisStep)
            {
                return;
            }
            ActionEntry ae = ActionEntry.MakeActionEntry(timeStep,
                                                         personGuid, personName, isSick, affordanceName, affordanceGuid,
                                                         householdKey, affordanceCategory, _dsc.MakeDateFromTimeStep(timeStep), bodilyActivityLevel);

            _actionEntries.Add(ae);
        }
Ejemplo n.º 7
0
        public CalcAffordance([NotNull] string pName,
                              [NotNull] CalcProfile personProfile,
                              [NotNull] CalcLocation loc,
                              bool randomEffect,
                              [NotNull][ItemNotNull] List <CalcDesire> satisfactionvalues,
                              int miniumAge,
                              int maximumAge,
                              PermittedGender permittedGender,
                              bool needsLight,
                              double timeStandardDeviation,
                              ColorRGB affordanceColor,
                              [NotNull] string pAffCategory,
                              bool isInterruptable,
                              bool isInterrupting,
                              [NotNull][ItemNotNull] List <CalcAffordanceVariableOp> variableOps,
                              [NotNull][ItemNotNull] List <VariableRequirement> variableRequirements,
                              ActionAfterInterruption actionAfterInterruption,
                              [NotNull] string timeLimitName,
                              int weight,
                              bool requireAllDesires,
                              [NotNull] string srcTrait,
                              StrGuid guid,
                              [NotNull] CalcVariableRepository variableRepository,
                              [NotNull][ItemNotNull] List <DeviceEnergyProfileTuple> energyprofiles,
                              [ItemNotNull][NotNull] BitArray isBusy, BodilyActivityLevel bodilyActivityLevel,
                              [NotNull] CalcRepo calcRepo) : base(pName,
                                                                  loc,
                                                                  satisfactionvalues,
                                                                  miniumAge,
                                                                  maximumAge,
                                                                  permittedGender,
                                                                  needsLight,
                                                                  randomEffect,
                                                                  pAffCategory,
                                                                  isInterruptable,
                                                                  isInterrupting,
                                                                  actionAfterInterruption,
                                                                  weight,
                                                                  requireAllDesires,
                                                                  CalcAffordanceType.Affordance,
                                                                  guid,
                                                                  isBusy, bodilyActivityLevel, calcRepo)
        {
            _variableOps          = variableOps;
            _variableRequirements = variableRequirements;
            _variableRepository   = variableRepository;
            Energyprofiles        = energyprofiles;
            SourceTrait           = srcTrait;
            if (personProfile == null)
            {
#pragma warning disable IDE0016 // Use 'throw' expression
                throw new DataIntegrityException("The affordance " + Name + " has no person profile!");
#pragma warning restore IDE0016 // Use 'throw' expression
            }

            _timeStandardDeviation = timeStandardDeviation;
            SubAffordances         = new List <CalcSubAffordance>();
            _personProfile         = personProfile;
            AffordanceColor        = affordanceColor;
            TimeLimitName          = timeLimitName;
        }