ในสถานการณ์ของภัยพิบัติ/ปรากฏการณ์ธรรมชาติการดับไฟอาจเกิดขึ้นได้ เพื่อต่อสู้กับสิ่งนี้ไดรเวอร์ EV (ยานพาหนะไฟฟ้า) สามารถใช้ยานพาหนะเป็นแบตเตอรี่สำหรับลูกค้า/ ลูกค้า เพื่อจำลองความยากลำบากของความท้าทายนี้ในการเข้าถึงลูกค้าให้มากที่สุดเท่าที่จะเป็นไปได้จนกว่าจะถึงช่วงเวลาที่มืดมนสิ้นสุดลงสภาพแวดล้อม RL ถูกสร้างขึ้น สภาพแวดล้อมนี้มีสถานการณ์แบบสุ่มตามขนาดเครือข่ายโหนดจำนวนบ้าน (ไม่ใหญ่กว่าขนาดโหนด) ข้อมูลการปิดกั้นและแบบจำลองที่อยู่อาศัยเพื่อจำลองการตอบสนองการดับไฟในระดับสูง

ตัวอย่างของเอเจนต์แบบสุ่มในการดำเนินการ
โหลดแสดงถึงกำลังที่จำเป็นในขณะนี้จากโหนด
ค่าใช้จ่ายปัจจุบันแสดงถึงพลังงานที่ตัวแทน (หรือรถยนต์) มี
ค่าบนขอบแสดงถึงไมล์ของค่าใช้จ่ายขอบที่จะผ่าน
โหนดสีน้ำเงินแสดงถึงบัฟเฟอร์ โหนดสีเขียวแสดงถึงบ้าน โหนดสีเทาแสดงถึงโหนดที่มืดมน
รายละเอียดเพิ่มเติมสามารถพบได้ในส่วนการดำเนินการและพื้นที่ของรัฐ
โคลนโครงการ
git clone https://github.com/Natemen96/ECEMasterProject.gitไปที่ไดเรกทอรีโครงการ
cd ECEMasterProject/RL python main.py คำเตือน: นี่คือการติดตั้งขนาดใหญ่ (~ 2GB) และจะใช้เวลาประมาณ 30 นาทีขึ้นอยู่กับความเร็วอินเทอร์เน็ต ขึ้นอยู่กับการตั้งค่าของคุณคุณอาจพบว่าติดตั้งแพ็คเกจด้วยตัวเองได้ง่ายขึ้น รายการสามารถพบได้ในโฟลเดอร์ conda_env ดู 'conda_env/rl_window.yml' สำหรับรายการแพ็คเกจที่ทันสมัยที่สุด ทำงานได้ดีที่สุดบน Windows
สำหรับการติดตั้งง่ายโดยใช้ conda ก่อนตรวจสอบให้แน่ใจว่าคุณติดตั้ง conda แล้ว
หลังจากติดตั้ง conda ให้ทำสิ่งต่อไปนี้เพื่อตั้งค่าสภาพแวดล้อม
conda env create -f conda_env/rl_window.yml --name rl_env # or any name you prefer
conda activate rl_env # verify it work ตรวจสอบให้แน่ใจว่าได้รันโปรแกรมภายใน Conda Env
ข้อมูลที่อยู่อาศัยสามารถดาวน์โหลดได้จาก Pecan Street/Dataport
เริ่มต้นที่ "Home" (โหนด) เดินทางไปแต่ละสถานที่เพื่อแลกกับพลังงาน (ทรัพยากรหลักสำหรับ EV) ยกเลิกการโหลดพลังงานเพื่อแลกกับรางวัลเดินทางกลับบ้านเพื่อแลกกับอำนาจ ตัวแทนสามารถกู้คืนอำนาจที่ "บ้าน" และรับรางวัลมากขึ้นขึ้นอยู่กับว่ามันกลับมาได้เท่าไหร่ ยิ่งพลังมากขึ้นสำหรับตัวเองก็ยิ่งได้รับรางวัลมากขึ้นเท่านั้น
เมื่อพลังงานได้รับการฟื้นฟูในโหนดด้วยสถานีชาร์จพลังงานตัวแทนสามารถกู้คืนพลังงานได้เช่นกัน บางโหนดจะว่างเปล่าขึ้นอยู่กับพารามิเตอร์
graph_env: Randomly generated a fully connected graph n nodes
Args:
n (int, optional): [number of nodes]. Defaults to 5.
numofhome (int, optional): [number of homes for agent starting
point]. Defaults to 1.
numofblackout (int, optional): [number of houses with blackout].
Defaults to 1.
numofblackoutws (int, optional): [number of blackout houses with
solarpower]. Defaults to 0.
numofchargingstation (int, optional): [number of charging
station]. Defaults to 0.
max_actions (int, optional): [max number of action can be done
times 7. By default 3 (7) = 21]. Defaults to 3.
blackout_str (str, optional): [Reads Blackout data from npy
file. Blackout data from the 2021 Texas Power Crisis, a file for
each country]. Defaults to 'Brazoria'.
agents (list, optional): [Agent objects]. Defaults to [None].
nonsolarhouse_data_paths (list, optional): [Path for npy file
with nonsolar data info. Added to a node per path.]. Defaults to
[None].
solarhouse_data_paths (list, optional): [Path for npy file with
solarhouse data info. Added to a node per path.]. Defaults to
[None].
data_sample (int, optional): [how many data sample it take from
data in paths, samples taken evenly throughout data. By default
(0/6. 1/6 ... 6/6 0/6 ...) sample]. Defaults to 6.BasicAgent: Basic Agent that act as skeleton for other agent. Won't work by itself.
Args:
car ([dict]): [car information in the form of a python
dictionary. Required dict information: model, make, year,
avg_energy_consumption(kWh/mile), battery_capacity(kWh)]SmartQLAgent: Smart Agent that uses Qtable to make decisions
Args:
car ([dict]): [car information in the form of a python
dictionary. Required dict information: model, make, year,
avg_energy_consumption(kWh/mile), battery_capacity(kWh)]
sample_rate (int, optional): [decides how often a sample of the
qtable is taken. If left to default it's every 1/100 of total ep]
. Defaults to 100.
qtabletraining (bool, optional): [Flag for turning qtable
training on]. Defaults to True.
quiet (bool, optional): [Flag for turning data collection on].
Defaults to True.RandomDataAgent: Used for data collection of random agent. Doesn't
use Observation.
Args:
car ([dict]): [car information in the form of a python
dictionary. Required dict information: model, make, year,
avg_energy_consumption(kWh/mile), battery_capacity(kWh)]รางวัลที่มอบให้สำหรับการขนถ่ายการชาร์จใหม่ ความหลากหลายของการฟื้นฟูพลังงานจะส่งผลให้ได้รับรางวัลมากขึ้น รางวัลที่หายไปสำหรับพลังงานหมด ตอนจบเมื่อ EV หมดพลังงานหรือเครือข่ายถูกขับเคลื่อนอย่างสมบูรณ์
Each Agent will have 24 actions per ep by default.
e+2 Actions:
e - Move (at cost) to Node if possible
1 - Unload (at cost)
1 - Recharge (no cost, expect an action)
2 * n + 6 * n + 300 * n + c States:
n - Statuses of Each Node
Key - Assignment
0 - Buffer (Blue)
1 - Blackout (Darkgrey)
2 - Blackout with Solar (Lightgrey)
3 - Powered (Blue)
4 - Charging Station (Yellow)
5 - Home (Green)
n - Cost of each edge
n - Is the path reachable or not?
0 - No
1 - Yes
c - Charge State (400 possible values by default)
where n is the number of nodes states, e is the number of edges, and c number of is Charge states แต่ละโหนดได้รับการออกแบบให้อยู่บนพื้นฐานของชุดข้อมูลบ้าน บ้านบางหลังที่ขับเคลื่อนด้วยพลังงานแสงอาทิตย์จะต้องใช้พลังงานน้อยลงจาก EVs เมื่อเทียบกับบ้านที่ไม่ใช่แสงอาทิตย์ ค่าใช้จ่ายของโหนดบ้านสามารถได้มาจากข้อมูลที่อยู่อาศัย
เปอร์เซ็นต์ของการปิดกั้นตามข้อมูล Texas Blackout รวมถึงการเปลี่ยนแปลงต่อวัน
อย่างน้อยที่สุดมีการใช้ Q-Learning เพื่อค้นหาวิธีแก้ปัญหาที่ดีที่สุด
สามารถปรับสัดส่วนเป็นหลาย EV (จำเป็นต้องมี Marl) และเครือข่ายขนาดใหญ่ Marl ยังไม่ได้รับการทดสอบอย่างเต็มที่และมีแนวโน้มที่จะบั๊กมาก
ในระหว่างการทดสอบของ EPS 50K เอเจนต์อัจฉริยะที่สนับสนุนด้วย QTables มีการปรับปรุง 263.13% เมื่อเทียบกับตัวแทนสุ่ม (ซึ่งเป็นการกระทำแบบสุ่ม)
scripts/Data/TexasBlackout.csv
-csv file of data collected from https://poweroutage.us/area/state/texas during the 2021 Texas Power Crisis with the following
- Metrics: ID,County,Customers Tracked,Customers Out,Outage %,DateTime
ECEMasterProject/RL/Data/
Avg_House_0/
- npy files of average daily power per every 15 mins of various houses provide by Dataport
Avg_House_1/
- npy files of next day regression of Avg_House_0 per house
Avg_House_n/
- npy files of concatenation of Avg_House_0 adn Avg_House_1 per houses
County/
- npy files of Texas County that were effect the most during the 2021 Texas Power Crisis
RL/agent/Sim_Data
- csv file result from various RL training, only stored reward.
RL/agent/agent_jsons/
-various json file of EV information
-Metrics: model, make, year, avg_energy_consumption(kWh/mile), battery_capacity(kWh), source
models/
KM/
-Classifier models trained using Time Series K Means stored in h5
LSTM/
-Old LSTM regression model trained on one house stored in h5
LSTM_nonsolar/
-LSTM regression model trained on non solar data stored in h5
LSTM_solar/
-LSTM regression model trained on solar data stored in h5
Qtables/
-Qtables from RL training stored in h5
notebooks/
analysis_c0.ipynb
-Analysis of classifier and regression model on solar houses data
analysis_c1.ipynb
-Analysis of classifier and regression model on nonsolar houses data
cluster.ipynb
-Creation and Analysis of classifier that can distinguish between solar and nonsolar data
compare_qtable_analyis.ipynb
-Comparing Qtable Smart Agent with Random Agent Baseline
D_LSTM_HousingData.ipynb
-Creation and analysis of regression on avg housing data where the original data sample occurs every 15 mins -> 98 sample per day
Dp1_analysis.ipynb
-Creation and analysis of regression on one house
EveryNyHouseAvg.ipynb
-Creation and analysis of regression on all house samples with model trained on one house (house 1)
LSTM_cluster0.ipynb
-Creation and analysis of regression on one house using most of the solar housing data
LSTM_cluster1.ipynb
-Creation and analysis of regression on one house using most of the nonsolar housing data
qtable_analyis_4_19.ipynb
-Analysis of Smart Agents performance
qtable_analyis_4_22.ipynb
-Analysis of Smart Agents performance
qtable_analyis.ipynb
-Analysis of Smart Agents performance
random_agent_analyis.ipynb
-Analysis of Random Agents performance
Texas_Blackout.ipynb
-Analysis of recorded Blackout Dataขอบบางส่วนสามารถปิดกั้นและกู้คืนได้ในภายหลังเป็นวันที่ผ่าน (จำลองสำหรับภัยธรรมชาติ)
เพิ่มการทดสอบ
เทคนิคการเพิ่มประสิทธิภาพ DRL และคลาสสิก
ดีบักสำหรับ Marl
แปลงเป็นสภาพแวดล้อม openai
เรียนรู้เพิ่มเติมเกี่ยวกับการสร้างแบบจำลอง DL/ML
เรียนรู้เพิ่มเติมเกี่ยวกับการวิเคราะห์ข้อมูลจากการสำรวจข้อมูลและผลลัพธ์จากการฝึกอบรม DL/ML
เรียนรู้เกี่ยวกับเครือข่ายและความสามารถของทฤษฎีกราฟที่เกี่ยวข้องกับโครงการ
เรียนรู้เพิ่มเติมเกี่ยวกับการสร้างสภาพแวดล้อมการเรียนรู้และตัวแทน
เรียนรู้เพิ่มเติมเกี่ยวกับการขูดข้อมูลตามที่ฉันต้องการเพื่อกำจัดข้อมูลที่ปิดไฟในช่วงวิกฤตพลังงานเท็กซัสปี 2021
เรียนรู้วิธีสร้าง GIF โดยใช้รูปภาพใน Python
ขอบคุณศาสตราจารย์ Qin จากโรงเรียนเก่าของฉัน Purdue University สำหรับการสนับสนุนที่น่าทึ่งและแบ่งปันความเชี่ยวชาญของเขาสำหรับโครงการนี้
ขอขอบคุณ DataPort และ Pecan Street ที่ให้ข้อมูลที่อยู่อาศัยเพื่อสร้างโมเดลด้วย
ขอขอบคุณ Matt Leacock ผู้สร้างเกมกระดานระบาดเพื่อสร้างแรงบันดาลใจให้กับสภาพแวดล้อมการเรียนรู้เสริมแรงนี้