人,通常都是在那些鸡毛蒜皮的小事上才会理智(摘)

人们往往在小事上表现得更为理智,如购物时精挑细选;而在重大决定面前,比如选择居住城市或恋爱对象时,则可能更加冲动。本文通过一个个人故事探讨了这种行为模式。
人,通常都是在那些鸡毛蒜皮的小事上才会理智,比如说买件衣服,你能够花上一整天的功夫,从价钱到款式到颜色,什么都能比较个半天,结果最后还没买。可是在那些决定性的事情上,却往往不理智,头脑一热,决定就下来了。当年我决定留北京,为什么呢?书太多了。至于恋爱,那就更简单了,一见钟情!
【EI复现】基于深度强化学习的微能源网能量管理与优化策略研究(Python代码实现)内容概要:本文围绕“基于深度强化学习的微能源网能量管理与优化策略”展开研究,重点利用深度Q网络(DQN)等深度强化学习算法对微能源网中的能量调度进行建模与优化,旨在应对可再生能源出力波动、负荷变化及运行成本等问题。文中结合Python代码实现,构建了包含光伏、储能、负荷等元素的微能源网模型,通过强化学习智能体动态决策能量分配策略,实现经济性、稳定性和能效的多重优化目标,并可能与其他优化算法进行对比分析以验证有效性。研究属于电力系统与工智能交叉领域,具有较强的工程应用背景和学术参考价值。; 适合群:具备一定Python编程基础和机器学习基础知识,从事电力系统、能源互联网、智能优化等相关方向的研究生、科研员及工程技术员。; 使用场景及目标:①学习如何将深度强化学习应用于微能源网的能量管理;②掌握DQN等算法在实际能源系统调度中的建模与实现方法;③为相关课题研究或项目开发提供代码参考和技术思路。; 阅读建议:建议读者结合提供的Python代码进行实践操作,理解环境建模、状态空间、动作空间及奖励函数的设计逻辑,同时可扩展学习其他强化学习算法在能源系统中的应用。
#include<bits/stdc++.h> #define ll long long using namespace std; static const int N = 2e5+5; static inline ll rd() { ll x = 0; char d = getchar_unlocked(); while (d < '0' || d > '9')d = getchar_unlocked(); while (d >= '0' && d <= '9') { x = (x << 3) + (x << 1) + (d ^ 48); d = getchar_unlocked(); } return x; } static inline void wr(ll x) { static ll len; static char ch[20]; if (x == 0) { putchar_unlocked('0'); putchar_unlocked(' '); return; } while (x) { ch[len++] = x % 10 ^ 48; x /= 10; } while (len)putchar_unlocked(ch[--len]); putchar_unlocked(' '); } //------------------------------------------------ struct node { ll x, y, id; node() {}; node(ll a, ll b): x(a), y(b) {}; } e; static vector<node> v1, v2, v3, v4; static inline bool p1(const node &a, const node &b) { if (a.x + a.y != b.x + b.y) return a.x + a.y < b.x + b.y; if (a.x != b.x) return a.x < b.x; return a.y < b.y; } static inline bool p2(const node &a, const node &b) { if (a.x - a.y != b.x - b.y) return a.x - a.y < b.x - b.y; if (a.x != b.x) return a.x < b.x; return a.y < b.y; } static inline bool p3(const node &a, const node &b) { if (-a.x + a.y != -b.x + b.y) return -a.x + a.y < -b.x + b.y; if (a.x != b.x) return a.x < b.x; return a.y < b.y; } static inline bool p4(const node &a, const node &b) { if (-(a.x + a.y) != -(b.x + b.y)) return -(a.x + a.y) < -(b.x + b.y); if (a.x != b.x) return a.x < b.x; return a.y < b.y; } struct edge { ll u, v, w; edge() {}; edge(ll a, ll b, ll c): u(a), v(b), w(c) {}; bool operator <(const edge& oth)const { return w < oth.w; } }; static inline ll get(const node &a, const node &b) { return abs(a.x - b.x) + abs(a.y - b.y); } vector<edge> v; vector<pair<int, int>> ans; static int Set[N]; static inline int f(int x) { return Set[x] == x ? x : Set[x] = f(Set[x]); } int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); static ll n, sum = 0; n = rd(); v1.reserve(n); v2.reserve(n); v3.reserve(n); v4.reserve(n); v.reserve(4 * n); for (int i = 1; i <= n; i++) { e.x = rd(), e.y = rd(), e.id = i; v1.emplace_back(e); v2.emplace_back(e); v3.emplace_back(e); v4.emplace_back(e); Set[i] = i; } //四向排序 sort(v1.begin(), v1.end(), p1); sort(v2.begin(), v2.end(), p2); sort(v3.begin(), v3.end(), p3); sort(v4.begin(), v4.end(), p4); //生成边 for (int i = 1; i < n; i++) { v.emplace_back(v1[i - 1].id, v1[i].id, get(v1[i - 1], v1[i])); v.emplace_back(v2[i - 1].id, v2[i].id, get(v2[i - 1], v2[i])); v.emplace_back(v3[i - 1].id, v3[i].id, get(v3[i - 1], v3[i])); v.emplace_back(v4[i - 1].id, v4[i].id, get(v4[i - 1], v4[i])); } sort(v.begin(), v.end()); //kruskal int Sz = v.size(), rx = 0, ry = 0, cnt = 0; for (int i = 0; i < Sz; i++) { rx = f(v[i].u), ry = f(v[i].v); if(rx != ry) { sum += v[i].w; Set[rx] = ry; cnt++; ans.emplace_back(v[i].u, v[i].v); if(cnt == n - 1)break; } } wr(sum); for(int i = 0; i<cnt; i++) { putchar_unlocked('\n'); wr(ans[i].first), wr(ans[i].second); } return 0; }还有那些问题?鸡毛蒜皮就不用了
08-11
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值