Ejemplo n.º 1
0
        public static void CheckConsistency([NotNull] CalcHousehold chh, [NotNull] CalcParameters calcParameters)
        {
            CheckTimeResolution(calcParameters);
            // check for the same device twice
            foreach (CalcLocation location in chh.Locations)
            {
                foreach (var calcAffordanceBase in location.Affordances)
                {
                    ICalcAffordanceBase affordance = calcAffordanceBase;
                    if (affordance.AreThereDuplicateEnergyProfiles())
                    {
                        throw new DataIntegrityException(
                                  "Same device twice in one Affordance: " + location.Name + " - " + affordance.Name);
                    }
                }
            }

            // check for timeprofiles without values
            foreach (CalcLocation calcLocation in chh.Locations)
            {
                foreach (var calcAffordanceBase in calcLocation.Affordances)
                {
                    ICalcAffordanceBase calcAffordance = calcAffordanceBase;
                    if (calcAffordance.AreDeviceProfilesEmpty() != null)
                    {
                        throw new DataIntegrityException("Timeprofile without values: " +
                                                         calcAffordance.AreDeviceProfilesEmpty());
                    }
                }
            }

            // persons  without desires
            foreach (CalcPerson calcPerson in chh.Persons)
            {
                if (calcPerson.DesireCount == 0)
                {
                    throw new DataIntegrityException("Person without desires: " + calcPerson.Name);
                }
            }

            if (calcParameters.InternalStepsize.TotalSeconds < 1)
            {
                throw new DataIntegrityException("Time resolution too small!");
            }
        }
Ejemplo n.º 2
0
 public bool AreThereDuplicateEnergyProfiles()
 {
     return(_sourceAffordance.AreThereDuplicateEnergyProfiles());
 }