자연 재해/현상의 상황에서 정전이 발생할 수 있습니다. 이를 위해 EV (전기 자동차) 운전자는 차량을 고객/ 고객을위한 배터리로 사용할 수 있습니다. 정전 기간이 끝날 때까지 가능한 많은 고객에게 도전하는이 과제의 어려움을 시뮬레이션하기 위해 RL 환경이 만들어졌습니다. 이 환경은 노드 네트워크 크기, 주택량 (노드 크기보다 클 수 없음), 정전 데이터 및 하우징 모델을 기반으로 한 임의의 시나리오를 특징으로하여 높은 수준의 문제에서 정전 응답을 시뮬레이션합니다.

무작위 에이전트의 예.
하중은 노드에서 필요한 순간에 필요한 전력을 나타냅니다.
현재 요금은 대리인 (또는 자동차)이 가지고있는 전력을 나타냅니다.
가장자리의 값은 통과하는 가장자리 비용의 마일을 나타냅니다.
파란색 노드는 버퍼를 나타냅니다. 녹색 노드는 주택을 나타냅니다. 회색 노드는 노드 블랙 아웃을 나타냅니다.
자세한 내용은 Action & State Space Section에서 찾을 수 있습니다.
프로젝트를 복제하십시오
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에서 다운로드 할 수 있습니다
"홈"(노드)에서 시작하여 전력 (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 각 노드는 하우스 데이터 세트를 기반으로 설계되었습니다. 태양열로 구동되는 일부 주택은 비극이 아닌 주택에 비해 EV의 전력이 적습니다. 주택 노드 비용은 주택 데이터에서 파생 될 수 있습니다.
Texas Blachout 데이터를 기반으로 한 정전 비율 및 하루에 변경.
최소한 Q- 러닝을 사용하여 최상의 솔루션을 찾았습니다.
다중 EV (Marl이 필요) 및 더 큰 네트워크로 확장 될 수 있습니다. Marl은 완전히 테스트되지 않았으며 매우 버그가 많을 것입니다.
50K EPS의 테스트 실행 중 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 DataDays Pass (자연 재해를 위해 시뮬레이션)에 따라 일부 가장자리를 차단하고 나중에 복원 할 수 있습니다.
테스트 추가
DRL 및 클래식 최적화 기술
Marl에 대한 디버그
OpenAI 환경으로 변환
DL/ML 모델 제작에 대해 더 많이 배웠습니다.
데이터 탐색 및 DL/ML 교육 결과에 대한 데이터 분석에 대해 더 많이 배웠습니다.
NetworkX에 대해 배웠으며 프로젝트와 관련된 그래프 이론의 기능입니다.
강화 학습 환경 및 에이전트 만들기에 대해 더 많이 배웠습니다.
2021 Texas Power Crisis 기간 동안 정전 데이터를 폐기 해야하는 데이터 스크래핑에 대해 더 많이 배웠습니다.
파이썬에서 이미지를 사용하여 GIF를 만드는 방법을 배웠습니다.
Purdue University의 Alma Mater의 Qin 교수 에게이 프로젝트에 대한 그의 놀라운 지원과 그의 전문 지식을 공유해 주셔서 감사합니다.
모델을 구축 할 주택 데이터를 제공해 주신 Dataport 및 Pecan Street에 감사드립니다.
이 강화 학습 환경에 영감을 주신 보드 게임 제작자 인 Matt Leacock에게 감사합니다.