POST | /optimizer/yearly |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using powerDev.Optimization.ServiceModel;
using powerDev.Optimization.Models;
using powerDev.Common.Types;
using powerDev.Common.Models;
using powerDev.Common.Types.Enums;
namespace powerDev.Common.Models
{
public partial class BatteryProjectTodItem
{
public virtual int Month { get; set; }
public virtual int WeekDay { get; set; }
public virtual int Hour { get; set; }
public virtual decimal Price { get; set; }
[Ignore]
public virtual string Id { get; set; }
}
public partial class BatteryScenarioKeyGroup
{
public virtual int KeyId { get; set; }
public virtual int Year { get; set; }
public virtual int NodeId { get; set; }
public virtual DataProvider Provider { get; set; }
public virtual int ZoneId { get; set; }
public virtual PowerPlantType PlantType { get; set; }
public virtual int SolarId { get; set; }
public virtual int WindId { get; set; }
public virtual bool IsServerless { get; set; }
}
public partial class BatteryScenarioKeyItem
{
public virtual Guid ProjectId { get; set; }
public virtual int KeyId { get; set; }
public virtual BatteryScenarioType KeyType { get; set; }
public virtual string RecordKey { get; set; }
public virtual int JobStatus { get; set; }
public virtual int Status { get; set; }
public virtual DateTime MinDate { get; set; }
public virtual DateTime MaxDate { get; set; }
public virtual int Year { get; set; }
public virtual int YoyStatus { get; set; }
public virtual decimal UsableCapacity { get; set; }
public virtual decimal UsableCapacityFactor { get; set; }
public virtual decimal SolarUsableCapacity { get; set; }
public virtual decimal SolarUsableCapacityFactor { get; set; }
public virtual PriceMarketType BaseMarket { get; set; }
public virtual decimal BaseCapacityRate { get; set; }
public virtual decimal CapacityRate { get; set; }
public virtual decimal SolarCapacityRate { get; set; }
public virtual decimal WindCapacityRate { get; set; }
public virtual decimal ChargeEfficinecy { get; set; }
public virtual decimal DischargeEfficinecy { get; set; }
public virtual int NodeId { get; set; }
public virtual DataProvider Provider { get; set; }
public virtual int ZoneId { get; set; }
public virtual int LmpFileId { get; set; }
public virtual int ProductionFileId { get; set; }
public virtual int LoadFileId { get; set; }
public virtual int CapacityFileId { get; set; }
public virtual PowerPlantType PlantType { get; set; }
public virtual int SolarId { get; set; }
public virtual int WindId { get; set; }
public virtual decimal AncillaryIncrementFactor { get; set; }
public virtual decimal EnergyIncrementFactor { get; set; }
public virtual decimal CapacityIncrementFactor { get; set; }
}
}
namespace powerDev.Common.Types
{
public enum BatteryProjectGroup
{
Undefined,
StandAlone,
FTM,
BTM,
}
public enum BatteryScenarioType
{
Undefined,
Optimization,
Sum,
OptiSum,
FullTod,
CapacityTod,
}
public enum BooleanValue
{
Undefined,
Yes,
No,
Custom,
}
public enum DataProvider
{
Undefined = 0,
SPP = 1,
ERCOT = 2,
MISO = 3,
CAISO = 4,
PJM = 5,
ISONE = 6,
NYISO = 7,
NW = 8,
SW = 9,
SE = 10,
AESO = 11,
IESO = 12,
CENACE = 20,
NONISO = 99,
EIA = 100,
PNM = 150,
NREL = 200,
NOAA = 210,
ENTSOE = 1000,
EPIAS = 1010,
SELF = 10000,
}
public enum PriceMarketType
{
Undefined = 0,
Realtime = 1,
DayAhead = 10,
DART = 101,
}
}
namespace powerDev.Common.Types.Enums
{
public enum PowerPlantType
{
Undefined,
Solar,
Wind,
Hybrid,
}
public enum RevenueStackingMode
{
SolveWithoutAncillary,
SolveWithAncillary,
}
}
namespace powerDev.Optimization.Models
{
public partial class MonthlyRequestBase
{
public virtual Guid ProjectId { get; set; }
public virtual int NodeAltId { get; set; }
public virtual DataProvider Iso { get; set; }
public virtual BooleanValue UseEnergy { get; set; }
public virtual BooleanValue UseAncillary { get; set; }
public virtual bool UseCapacityTod { get; set; }
public virtual PriceMarketType BaseMarket { get; set; }
public virtual IEnumerable<BatteryProjectTodItem> CapacityTODs { get; set; }
public virtual decimal UseRegup { get; set; }
public virtual decimal UseRegdown { get; set; }
public virtual decimal UseSpinning { get; set; }
public virtual decimal UseNonSpinning { get; set; }
public virtual decimal ParaciticLossesOperation { get; set; }
public virtual decimal ParaciticLossesResting { get; set; }
public virtual decimal HVACLosses { get; set; }
public virtual decimal AcCablingLosses { get; set; }
public virtual decimal TransformatorLosses { get; set; }
public virtual decimal OtherLosses { get; set; }
public virtual int RepresentativeYear { get; set; }
public virtual int IncrementReferanceYear { get; set; }
public virtual int UseFutureData { get; set; }
public virtual decimal MaxDailyCycle { get; set; }
public virtual decimal MinDailyProfitPerMw { get; set; }
public virtual int AncillaryFileId { get; set; }
public virtual int LmpFileId { get; set; }
public virtual decimal MaxChargingPriceCap { get; set; }
public virtual decimal MaxDischargingPriceCap { get; set; }
public virtual decimal MaxAncillaryPriceCap { get; set; }
public virtual RevenueStackingMode RevenueStackingMode { get; set; }
public virtual int OptimizationQuality { get; set; }
public virtual int EnsureExlusive { get; set; }
public virtual int NodeRefId { get; set; }
public virtual bool UseInternalSolver { get; set; }
}
public partial class YearlyApiStatusResponse
{
public virtual int FailedCount { get; set; }
public virtual string Message { get; set; }
}
}
namespace powerDev.Optimization.ServiceModel
{
public partial class CommonOptimizerYearlyRequest
: MonthlyRequestBase
{
public virtual int Month { get; set; }
public virtual BatteryScenarioKeyGroup Group { get; set; }
public virtual BatteryScenarioKeyItem Key { get; set; }
public virtual BatteryProjectGroup ProjectGroup { get; set; }
}
}
C# CommonOptimizerYearlyRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /optimizer/yearly HTTP/1.1
Host: dev-optimization.power.dev
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CommonOptimizerYearlyRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.ServiceModel">
<AcCablingLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</AcCablingLosses>
<AncillaryFileId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</AncillaryFileId>
<BaseMarket xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">Undefined</BaseMarket>
<CapacityTODs xmlns:d2p1="http://schemas.datacontract.org/2004/07/powerDev.Common.Models" i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models" />
<EnsureExlusive xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</EnsureExlusive>
<HVACLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</HVACLosses>
<IncrementReferanceYear xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</IncrementReferanceYear>
<Iso xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">Undefined</Iso>
<LmpFileId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</LmpFileId>
<MaxAncillaryPriceCap xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MaxAncillaryPriceCap>
<MaxChargingPriceCap xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MaxChargingPriceCap>
<MaxDailyCycle xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MaxDailyCycle>
<MaxDischargingPriceCap xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MaxDischargingPriceCap>
<MinDailyProfitPerMw xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MinDailyProfitPerMw>
<NodeAltId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</NodeAltId>
<NodeRefId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</NodeRefId>
<OptimizationQuality xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</OptimizationQuality>
<OtherLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</OtherLosses>
<ParaciticLossesOperation xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</ParaciticLossesOperation>
<ParaciticLossesResting xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</ParaciticLossesResting>
<ProjectId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">00000000-0000-0000-0000-000000000000</ProjectId>
<RepresentativeYear xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</RepresentativeYear>
<RevenueStackingMode xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">SolveWithoutAncillary</RevenueStackingMode>
<TransformatorLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</TransformatorLosses>
<UseAncillary xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">Undefined</UseAncillary>
<UseCapacityTod xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">false</UseCapacityTod>
<UseEnergy xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">Undefined</UseEnergy>
<UseFutureData xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseFutureData>
<UseInternalSolver xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">false</UseInternalSolver>
<UseNonSpinning xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseNonSpinning>
<UseRegdown xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseRegdown>
<UseRegup xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseRegup>
<UseSpinning xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseSpinning>
<Group xmlns:d2p1="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">
<d2p1:IsServerless>false</d2p1:IsServerless>
<d2p1:KeyId>0</d2p1:KeyId>
<d2p1:NodeId>0</d2p1:NodeId>
<d2p1:PlantType>Undefined</d2p1:PlantType>
<d2p1:Provider>Undefined</d2p1:Provider>
<d2p1:SolarId>0</d2p1:SolarId>
<d2p1:WindId>0</d2p1:WindId>
<d2p1:Year>0</d2p1:Year>
<d2p1:ZoneId>0</d2p1:ZoneId>
</Group>
<Key xmlns:d2p1="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">
<d2p1:AncillaryIncrementFactor>0</d2p1:AncillaryIncrementFactor>
<d2p1:BaseCapacityRate>0</d2p1:BaseCapacityRate>
<d2p1:BaseMarket>Undefined</d2p1:BaseMarket>
<d2p1:CapacityFileId>0</d2p1:CapacityFileId>
<d2p1:CapacityIncrementFactor>0</d2p1:CapacityIncrementFactor>
<d2p1:CapacityRate>0</d2p1:CapacityRate>
<d2p1:ChargeEfficinecy>0</d2p1:ChargeEfficinecy>
<d2p1:DischargeEfficinecy>0</d2p1:DischargeEfficinecy>
<d2p1:EnergyIncrementFactor>0</d2p1:EnergyIncrementFactor>
<d2p1:JobStatus>0</d2p1:JobStatus>
<d2p1:KeyId>0</d2p1:KeyId>
<d2p1:KeyType>Undefined</d2p1:KeyType>
<d2p1:LmpFileId>0</d2p1:LmpFileId>
<d2p1:LoadFileId>0</d2p1:LoadFileId>
<d2p1:MaxDate>0001-01-01T00:00:00</d2p1:MaxDate>
<d2p1:MinDate>0001-01-01T00:00:00</d2p1:MinDate>
<d2p1:NodeId>0</d2p1:NodeId>
<d2p1:PlantType>Undefined</d2p1:PlantType>
<d2p1:ProductionFileId>0</d2p1:ProductionFileId>
<d2p1:ProjectId>00000000-0000-0000-0000-000000000000</d2p1:ProjectId>
<d2p1:Provider>Undefined</d2p1:Provider>
<d2p1:RecordKey>String</d2p1:RecordKey>
<d2p1:SolarCapacityRate>0</d2p1:SolarCapacityRate>
<d2p1:SolarId>0</d2p1:SolarId>
<d2p1:SolarUsableCapacity>0</d2p1:SolarUsableCapacity>
<d2p1:SolarUsableCapacityFactor>0</d2p1:SolarUsableCapacityFactor>
<d2p1:Status>0</d2p1:Status>
<d2p1:UsableCapacity>0</d2p1:UsableCapacity>
<d2p1:UsableCapacityFactor>0</d2p1:UsableCapacityFactor>
<d2p1:WindCapacityRate>0</d2p1:WindCapacityRate>
<d2p1:WindId>0</d2p1:WindId>
<d2p1:Year>0</d2p1:Year>
<d2p1:YoyStatus>0</d2p1:YoyStatus>
<d2p1:ZoneId>0</d2p1:ZoneId>
</Key>
<Month>0</Month>
<ProjectGroup>Undefined</ProjectGroup>
</CommonOptimizerYearlyRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <YearlyApiStatusResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models"> <FailedCount>0</FailedCount> <Message>String</Message> </YearlyApiStatusResponse>