Beispiel #1
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;
 }
Beispiel #2
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 InterruptionHandlerEntry(ActionAfterInterruption action, [NotNull] string description)
 {
     Action      = action;
     Description = description;
 }
        public static string ConvertToDescription(ActionAfterInterruption tc)
        {
            var entries = MakeAllEntries();

            return(entries.First(x => x.Action == tc).Description);
        }
Beispiel #5
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;
        }