这是一种方法,叫成本利润法!
做决策电价用的!
包名称 类名称
decisionalgorithm CostProfitMethodDayBian 成员方法 public double [][][] calculation(int periodNumber,int bidSegmentNumber,double[] forecastPrice,double[] forecastPower,double userProfitRate,double[] userPowerRatio,double[] userRatioPercent,double bidMinPrice,double bidMaxPrice,double minPower,double maxPower,double costCoefficientA,double costCoefficientB,double costCoefficientC,boolean isCanDownBid,boolean isModifyMarginalPrice) 方法calculation输入参数
参数名称 参数类型
periodNumber int
bidSegmentNumber int
forecastPrice double[]
forecastPower double[]
userProfitRate double
userPowerRatio double[]
userRatioPercent double[]
bidMinPrice double
bidMaxPrice double
minPower double
maxPower double
costCoefficientA double
costCoefficientB double
costCoefficientC double
isCanDownBid boolean
isModifyMarginalPrice boolean
bidData double[][][]
以下是程序代码
for(int i=0;i<bidSegmentNumber-1;i++)
sum+=userPowerRatio[i];
for(int i=1;i<bidSegmentNumber-1;i++)
bidPower[i]=bidPower[i-1]+(maxPower-minPower)*userPowerRatio[i-1]/sum;
bidPrice[i] = costCoefficientA*powerPoint[i]*powerPoint[i] + costCoefficientB * powerPoint[i] + costCoefficientC;
bidPrice[i]*= (1+userProfitRate/100.0);
if(isModifyMarginalPrice)
if(bidPrice[j]>forecastPrice[i])
bidPrice[j]=forecastPrice[i];
if(isCanDownBid==false)
if(j>0)
{ if(bidPrice[j-1]>bidPrice[j])
bidPrice[j]=bidPrice[j-1];
}//if
//计算结果利润
bidProfit=bidPrice[j]-costPrice[j];
if(bidProfit<0.0) bidProfit=0.0; double m_tao=forecastPrice[i]/10.0;
double m_timescoff=2.5;
if (bidPrice[j]>=(forecastPrice[i]-m_timescoff*m_tao) && bidPrice[j]<=(forecastPrice[i]+m_timescoff*m_tao))
{
bidRisk=Math.abs((bidPrice[j]-(forecastPrice[i]-m_timescoff*m_tao))/(m_timescoff*2*m_tao)*100);//写结果市场风险
if(bidRisk>100) bidRisk=100;
}
if (bidPrice[j]<(forecastPrice[i]-m_timescoff*m_tao))
{
bidRisk=0;
}
if (bidPrice[j]>(forecastPrice[i]+m_timescoff*m_tao))
{
bidRisk=100;
} bidPossessionRatio =bidPower[j]/forecastPower[i]*100; //计算市场占有率
还有接口,我看不懂:
在bds.DayBid48.getBidData()中建立CostProfitMethodDayBian一个实例,再调用该实例的方法calculation。
代码如下:
CostProfitMethodDayBian tempMethod = new CostProfitMethodDayBian();
bidData = tempMethod.calculation (PeriodNumber,BidSegmentNum,forePrice,forePowerQ, ProfitRate,PowerRate,PowerRatePer,DayMinPrice,DayMaxPrice,UnitMinPower,UnitMaxPower,mCostA,mCostB,mCostC,bidDownFlag,modifyFlag);
麻烦大哥帮我参谋一下
我不知道怎么调试,也不知道哪里出错了,肯请大哥大姐帮忙!!
做决策电价用的!
包名称 类名称
decisionalgorithm CostProfitMethodDayBian 成员方法 public double [][][] calculation(int periodNumber,int bidSegmentNumber,double[] forecastPrice,double[] forecastPower,double userProfitRate,double[] userPowerRatio,double[] userRatioPercent,double bidMinPrice,double bidMaxPrice,double minPower,double maxPower,double costCoefficientA,double costCoefficientB,double costCoefficientC,boolean isCanDownBid,boolean isModifyMarginalPrice) 方法calculation输入参数
参数名称 参数类型
periodNumber int
bidSegmentNumber int
forecastPrice double[]
forecastPower double[]
userProfitRate double
userPowerRatio double[]
userRatioPercent double[]
bidMinPrice double
bidMaxPrice double
minPower double
maxPower double
costCoefficientA double
costCoefficientB double
costCoefficientC double
isCanDownBid boolean
isModifyMarginalPrice boolean
bidData double[][][]
以下是程序代码
for(int i=0;i<bidSegmentNumber-1;i++)
sum+=userPowerRatio[i];
for(int i=1;i<bidSegmentNumber-1;i++)
bidPower[i]=bidPower[i-1]+(maxPower-minPower)*userPowerRatio[i-1]/sum;
bidPrice[i] = costCoefficientA*powerPoint[i]*powerPoint[i] + costCoefficientB * powerPoint[i] + costCoefficientC;
bidPrice[i]*= (1+userProfitRate/100.0);
if(isModifyMarginalPrice)
if(bidPrice[j]>forecastPrice[i])
bidPrice[j]=forecastPrice[i];
if(isCanDownBid==false)
if(j>0)
{ if(bidPrice[j-1]>bidPrice[j])
bidPrice[j]=bidPrice[j-1];
}//if
//计算结果利润
bidProfit=bidPrice[j]-costPrice[j];
if(bidProfit<0.0) bidProfit=0.0; double m_tao=forecastPrice[i]/10.0;
double m_timescoff=2.5;
if (bidPrice[j]>=(forecastPrice[i]-m_timescoff*m_tao) && bidPrice[j]<=(forecastPrice[i]+m_timescoff*m_tao))
{
bidRisk=Math.abs((bidPrice[j]-(forecastPrice[i]-m_timescoff*m_tao))/(m_timescoff*2*m_tao)*100);//写结果市场风险
if(bidRisk>100) bidRisk=100;
}
if (bidPrice[j]<(forecastPrice[i]-m_timescoff*m_tao))
{
bidRisk=0;
}
if (bidPrice[j]>(forecastPrice[i]+m_timescoff*m_tao))
{
bidRisk=100;
} bidPossessionRatio =bidPower[j]/forecastPower[i]*100; //计算市场占有率
还有接口,我看不懂:
在bds.DayBid48.getBidData()中建立CostProfitMethodDayBian一个实例,再调用该实例的方法calculation。
代码如下:
CostProfitMethodDayBian tempMethod = new CostProfitMethodDayBian();
bidData = tempMethod.calculation (PeriodNumber,BidSegmentNum,forePrice,forePowerQ, ProfitRate,PowerRate,PowerRatePer,DayMinPrice,DayMaxPrice,UnitMinPower,UnitMaxPower,mCostA,mCostB,mCostC,bidDownFlag,modifyFlag);
麻烦大哥帮我参谋一下
我不知道怎么调试,也不知道哪里出错了,肯请大哥大姐帮忙!!
解决方案 »
- JAVA 四则运算 代码
- 大家帮个忙急啊!!!
- 我的一点疑问
- 关于try-catch的问题
- java最常用是哪几个包
- 在JCreate下新建了项目也可以调试,怎样才能在单步时监视变量的值。
- java 编译时 错误提示 Exception in thread "main" java.lang.NoSuchMethodError
- 如何完整的输出除法的结果,包括整数和小数位?
- Socket的问题:怎样确定socket目标地址确实存在???,通过IP进行socket连接的堵塞问题
- 求源代码!
- 什么原因不能显示有图标的button?
- Java如何使程序窗口始终处于屏幕的最上层?(类似于FlashGet)
3重数组加一大堆变量参数,第一次看到这么复杂的函数.
format一下代码吧,这样看死人了