Exemplo n.º 1
0
 public CalcRepo(
     [CanBeNull] IOnlineDeviceActivationProcessor odap = null,
     [CanBeNull] Random rnd = null,
     [CanBeNull] CalcParameters calcParameters        = null,
     [CanBeNull] IOnlineLoggingData onlineLoggingData = null,
     [CanBeNull] NormalRandom normalRandom            = null,
     [CanBeNull] ILogFile lf = null,
     [CanBeNull] SqlResultLoggingService srls            = null,
     [CanBeNull] IInputDataLogger inputDataLogger        = null,
     [CanBeNull] CalculationProfiler calculationProfiler = null,
     [CanBeNull] FileFactoryAndTracker fft = null,
     [CanBeNull] DateStampCreator dsc      = null)
 {
     _dateStampCreator = dsc;
     _fft               = fft;
     _odap              = odap;
     _rnd               = rnd;
     _calcParameters    = calcParameters;
     _onlineLoggingData = onlineLoggingData;
     _normalRandom      = normalRandom;
     _lf                  = lf;
     _srls                = srls;
     _inputDataLogger     = inputDataLogger;
     _calculationProfiler = calculationProfiler;
 }
        public CalcEnergyStorage([NotNull] IOnlineDeviceActivationProcessor odap,
                                 [NotNull] CalcLoadTypeDto loadType,
                                 double maximumStorageRate, double maximumWithdrawRate, double minimumStorageRate,
                                 double minimumWithdrawRate,
                                 double initialFill, double storageCapacity, [CanBeNull] EnergyStorageLogfile elf,
                                 [NotNull] CalcDeviceDto deviceDto)
            : base(deviceDto.Name, deviceDto.Guid)
        {
            //_devProcessorKey = new OefcKey(householdKey, OefcDeviceType.Storage, guid, "-1", loadType.Guid,"Energy Storage");
            _odap            = odap;
            _inputLoadType   = loadType;
            _deviceDto       = deviceDto;
            _devProcessorKey = _odap.RegisterDevice(_inputLoadType, deviceDto);

            _maximumStorageRate  = maximumStorageRate;
            _maximumWithdrawRate = maximumWithdrawRate;
            _minimumStorageRate  = minimumStorageRate;
            _minimumWithdrawRate = minimumWithdrawRate;
            var correctInitialFill = initialFill / _inputLoadType.ConversionFactor;

            PreviousFillLevel = correctInitialFill;
            _storageCapacity  = storageCapacity / _inputLoadType.ConversionFactor;
            _currentFillLevel = correctInitialFill;
            _elf = elf;
            var capacity = storageCapacity + " " + loadType.UnitOfSum + " - initial fill " + initialFill + " " +
                           loadType.UnitOfSum;

            _headerEntry = new EnergyStorageHeaderEntry(Name, capacity, _inputLoadType.FileName);

            _elf?.RegisterStorage(Name, _headerEntry);
        }
Exemplo n.º 3
0
 public CalcGenerator([NotNull] IOnlineDeviceActivationProcessor odap,
                      [NotNull] CalcLoadType loadType,
                      [NotNull] List <double> values,
                      [NotNull] CalcParameters calcParameters, [NotNull] CalcDeviceDto calcDeviceDto) : base(calcDeviceDto.Name, calcDeviceDto.Guid)
 {
     //_devProcessorKey = new OefcKey(householdKey, OefcDeviceType.Generator, guid, "-1", loadType.Guid, "Generator");
     _odap            = odap;
     _loadType        = loadType;
     _values          = values;
     _devProcessorKey = _odap.RegisterDevice(_loadType.ConvertToDto(), calcDeviceDto);
     if (values.Count != calcParameters.InternalTimesteps)
     {
         throw new LPGException("Not enough values in the generator to fill the entire period!");
     }
 }
Exemplo n.º 4
0
 public CalcTransformationDevice([NotNull] IOnlineDeviceActivationProcessor odap, double minValue,
                                 double maxValue, double minimumOutputPower, double maximumInputPower, [NotNull] CalcDeviceDto deviceDto,
                                 [NotNull] CalcLoadType inputLoadType)
     : base(deviceDto.Name, deviceDto.Guid)
 {
     _odap            = odap;
     _minValue        = minValue;
     _maxValue        = maxValue;
     _outputLoadTypes = new List <OutputLoadType>();
     _conditions      = new List <CalcTransformationCondition>();
     _minPower        = minimumOutputPower;
     _maxPower        = maximumInputPower;
     _inputLoadType   = inputLoadType;
     _deviceDto       = deviceDto;
 }