collect the code

IAMJourney 2010-08-23 12:49:00
as the title
...全文
126 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
IAMJourney 2010-09-03
  • 打赏
  • 举报
回复
FileInputStream :read() :用于读取诸如图像数据之类的原始字节流。要读取字符流,请考虑使用 FileReade
FileOutputStream:write()
FileReader:read()
FileWriter:writer()

BufferedInputStream:read(),传入一个InputStream

BufferedReader:传入一个Reader,
int read(),String readLine()

BufferedWriter:write(),newLine(),flush()

Collections: sort,max,min,reverse, replaceAll(List<T> list,T oldVal,T newVal)
Arrays: sort,toString


取出sql表中第31到40的记录(以自动增长ID为主键)
sql server方案1:select top 10 * from t where id not in (select top 30 id from t order by id ) orde by id
sql server方案2:select top 10 * from t where id in (select top 40 id from t order by id) order by id desc

mysql方案:select * from t order by id limit 30,10

oracle方案:select * from (select rownum r,* from t where r<=40) where r>30

相比以下效率高:select * from emp where rownum<=40 minus select * from emp where rounum<31;

select distinct name from score where name not in (select distinct name from score where score<=80)
注:mysql也有distinct关键字

select sales.year ,
(select t.amount from sales t where t.month='1' and t.year= sales.year) '1',
(select t.amount from sales t where t.month='1' and t.year= sales.year) '2',
(select t.amount from sales t where t.month='1' and t.year= sales.year) '3',
(select t.amount from sales t where t.month='1' and t.year= sales.year) as '4'
from sales group by year;
结果:
year m1 m2 m3 m4
1991 1.1 1.2 1.3 1.4
1992 2.1 2.2 2.3 2.4



123/10 = 12
8%10 = 8
IAMJourney 2010-09-03
  • 打赏
  • 举报
回复
var sUsrAgent=navigator.userAgent;
var isIE=sUsrAgent.indexOf("MSIE")!=-1;
var isIE6=isIE&&sUsrAgent.indexOf("MSIE 6.0")!=-1;
var isIE7=isIE&&sUsrAgent.indexOf("MSIE 7.0")!=-1;
var isFF=sUsrAgent.indexOf("Firefox")!=-1;
var isOP=sUsrAgent.indexOf("Opera")!=-1;
var isSF=sUsrAgent.indexOf("Safari")!=-1
IAMJourney 2010-09-01
  • 打赏
  • 举报
回复
function test(){
var start = Date.parse(document.getElementById("begin").value);//Date.parse("2010/4/09 02:03:10");
var end = Date.parse(document.getElementById("end").value);//Date.parse("2010/5/04 05:08:50");
document.writeln("最开始时间:" + start);
document.writeln("最后的时间" + end);
var value = end-start;
var flag = value > 31*24*60*60*1000;//时间段是否在一个月内( 以31天计算)
if(flag){
alert("时间段不能超过一个月");
return;
}
var timeStep = 12*60*60*1000;
var times = Math.ceil(value/timeStep);//计算总下发次数
document.writeln("下发次数:" + times);
var d = new Date();
var d2 = new Date();
var startDate;
var endDate = start;
for(var i = 0;i < times;i++){//把时间段以时间步长为12小时进行循环查询
startDate = endDate;
if(i == times-1){
endDate = end;
}else{
endDate += timeStep;
}
d.setTime(startDate);
d2.setTime(endDate);
document.writeln("开始时间:"+d.toLocaleString());
document.writeln("结束时间:"+d2.toLocaleString());
}

}
内容概要:本文围绕基于NSGA-2算法的电-热-气综合需求响应(IDR)在综合能源系统中的多目标优化问题展开研究,提出了一种融合智能优化算法与能源系统协同调度的解决方案。研究系统性地构建了包含电力、热力与天然气多能耦合的综合能源系统模型,设计了以能效提升、运行成本降低和环境效益优化为目标的多目标优化框架,并采用NSGA-2算法求解该复杂非线性优化问题,获得Pareto最优解集。文中详细阐述了IDR机制建模方法、多目标优化问题的数学建模过程以及NSGA-2算法的关键实现步骤,包括编码方式、交叉变异策略与非支配排序机制,并通过Matlab代码实现了完整的仿真验证流程,展示了该方法在平衡多个冲突目标方面的优越性能。; 适合人群:具备电力系统、能源系统建模或优化算法基础的研究生、科研人员及工程技术人员,特别适用于从事综合能源系统规划、需求响应策略设计、多目标进化算法应用等相关领域的研究人员; 使用场景及目标:①应用于综合能源系统的运行优化与规划决策,支持多能互补场景下的协同调度分析;②为科研工作者提供NSGA-2算法在能源系统中实际应用的完整Matlab代码实现范例,助力学术论文复现、算法改进与模型拓展; 阅读建议:建议读者结合文中提供的Matlab代码,按照系统建模、目标函数设计、约束处理到算法实现的研究脉络逐步学习,重点关注Pareto前沿的生成过程、多目标权衡分析及算法参数敏感性,以深入掌握多目标进化算法在复杂能源系统优化中的工程化应用方法。

259

社区成员

发帖
与我相关
我的任务
社区描述
其他产品/厂家
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧