diff --git a/.classpath b/.classpath index 3a36b19..02c589f 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,5 @@ - @@ -23,5 +22,6 @@ + diff --git a/README.md b/README.md index ce0b82c..cc58900 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ In this project, we explore to use deep reinforcement learning methods for contr ``` cd RLGC - conda env create -f environment. yml + conda env create -f environment.yml ``` or you can create your own environment. The main dependent modules/libs include gym, tensorflow, py4j, numpy, matplotlib, stable-baselines,jupyter-notebooks @@ -62,14 +62,11 @@ grid environment definition version 5 (PowerDynSimEnvDef_v5.py) The server will be started automatically when the grid environment ``PowerDynSimEnv`` is created. - To launch the training, you need first activate the virtual -environment. Then run the following scripts. -```trainKundur2areaGenBrakingAgent.py``` is used for training -the generator braking agent for the Kundur 2-area system and ```trainIEEE39LoadSheddingAgent_*.py``` is used for training an agent for regional load shedding in IEEE 39-bus system - +environment. Then run the training scripts under the folder ``` source activate -cd RLGC/src/py +cd RLGC/examples/IEEE39_load_shedding/ python trainIEEE39LoadSheddingAgent_discrete_action.py ``` diff --git a/docs/Dev_notes b/docs/Dev_notes deleted file mode 100644 index c28a487..0000000 --- a/docs/Dev_notes +++ /dev/null @@ -1,64 +0,0 @@ -===================== -V0.93 improve data adapter for PSS/E V33 and add APIs for accessing Adjacency Matrix, setting branch, generator and load status - -===================== -V0.92 add APIs to access generation and load information - -===================== -V0.91 transfer the observation array in byte array to python. - - -===================== -V0.90 to fix bugs in the load models. - - -===================== -V0.89 add the capability of selecting different base cases. - - - -===================== -V0.88 fixed a bug of parsing "0.000" as integer, first detected in IEEE300 bus system dynamic dyr file. - - -===================== -V0.87 fixed a bug with memory overheap issue with caching the observations with large number of RL training steps. - -Set this.sm = null within the reset() function of IpssPyGateway class. - -===================== -V0.86 fixed a bug with verbose setting. The verbose settings could be updated through the new setLoggerLevel() function. - -===================== -V0.85 fixed a bug in mapping faultBusIdx to actual system fault bus; now in IPSS-RL, the fault busIdx is based on the faultCandidate list in the RL configuration file, not the whole system bus list. - consistent with PowerDynSimEnvDef (v5) - -===================== -V0.84 fixed a bug in mapping faultBusIdx to actual system fault bus; now in IPSS-RL, the fault busIdx is based on the faultCandidate list in the RL configuration file, not the whole system bus list. - consistent with PowerDynSimEnvDef (v5) - -===================== -V0.83 -1. provided an option for unsymmetrical action space transformation in PowerDynSimEnvDef (v5) -2. provided verbose control configuration for PowerDynSimEnvDef (v5) - -===================== -V0.82 -1) PowerDynSimEnvDef (v5) simplifies the environment creation by moving the IpssGateWay setup into env.init() function -2) Create the PowerDynSimEnvDef (v5) test case -3) Update the lib to V0.82 -4) Update the IEEE39 Bus test cases to base on PowerDynSimEnvDef (v5) -===================== -V0.80 -1) updated IpssGateWay, json configuration file definition and PowerDynSimEnvDef (the latest is v4)to support continuous control actions. -2) updated PowerDynSimEnvDef (v4) and test cases to support recent versions of OpenAI Gym and OpenAI Baselines. Our internal test environments are: OpenAI gym (0.15.3) and baselines (0.1.5) - -===================== -V0.72 updated IpssGateWay, and replace the use of "global" variables for gateway ans ipss_app in python end to address the errors occuring during multi-processing - -===================== -V0.71 add observation output variable names - - -===================== -V0.70 development for the LDRD project and IEEE TSG paper \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 69fe55e..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 4d9eb83..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index f92ff2b..0000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,204 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Configuration file for the Sphinx documentation builder. -# -# This file does only contain a selection of the most common options. For a -# full list see the documentation: -# http://www.sphinx-doc.org/en/master/config - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - - -# -- Project information ----------------------------------------------------- - -project = 'RLGC' -copyright = '2019, Qiuhua Huang' -author = 'Qiuhua Huang' - -# The short X.Y version -version = '' -# The full version, including alpha/beta/rc tags -release = '0.82.0' - - -# -- General configuration --------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.todo', - 'sphinx.ext.coverage', - 'sphinx.ext.mathjax', - 'sphinx.ext.ifconfig', - 'sphinx.ext.viewcode', - 'sphinx.ext.githubpages', - 'recommonmark', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['RLGCtemplates'] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = None - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'alabaster' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# -# html_theme_options = {} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['RLGCstatic'] - -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. -# -# The default sidebars (for documents that don't match any pattern) are -# defined by theme itself. Builtin themes are using these templates by -# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', -# 'searchbox.html']``. -# -# html_sidebars = {} - - -# -- Options for HTMLHelp output --------------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = 'RLGCdoc' - -html_context = { - "display_github": True, # Integrate GitHub - "github_user": "qhuang-pnl", # Username - "github_repo": "RLGC", # Repo name - "github_version": "master", # Version - "conf_py_path": "/", # Path in the checkout to the docs root -} - - -# -- Options for LaTeX output ------------------------------------------------ - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'RLGC.tex', 'RLGC Documentation', - 'Qiuhua Huang', 'manual'), -] - - -# -- Options for manual page output ------------------------------------------ - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'rlgc', 'RLGC Documentation', - [author], 1) -] - - -# -- Options for Texinfo output ---------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'RLGC', 'RLGC Documentation', - author, 'RLGC', 'One line description of project.', - 'Miscellaneous'), -] - - -# -- Options for Epub output ------------------------------------------------- - -# Bibliographic Dublin Core info. -epub_title = project - -# The unique identifier of the text. This can be a ISBN number -# or the project homepage. -# -# epub_identifier = '' - -# A unique identification for the text. -# -# epub_uid = '' - -# A list of files that should not be packed into the epub file. -epub_exclude_files = ['search.html'] - - -# -- Extension configuration ------------------------------------------------- - -# -- Options for intersphinx extension --------------------------------------- - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'https://docs.python.org/': None} - -# -- Options for todo extension ---------------------------------------------- - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index 1f70393..0000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. RLGC documentation master file, created by - sphinx-quickstart on Thu Dec 26 15:44:15 2019. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to RLGC's documentation! -================================ - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - source/updates - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/examples/IEEE300_load_shedding/test_IEEE300_Zone1_loadshedding.py b/examples/IEEE300_load_shedding/test_IEEE300_Zone1_loadshedding.py index ec4f78b..7267179 100644 --- a/examples/IEEE300_load_shedding/test_IEEE300_Zone1_loadshedding.py +++ b/examples/IEEE300_load_shedding/test_IEEE300_Zone1_loadshedding.py @@ -6,7 +6,7 @@ java_port = 25338 -jar_file = '/lib/RLGCJavaServer1.0.0_alpha.jar' +jar_file = '/lib/RLGCJavaServer1.0.0_rc.jar' diff --git a/examples/Kundur_2area_dynamic_breaking/trainKundur2areaGenBrakingAgent.py b/examples/Kundur_2area_dynamic_breaking/trainKundur2areaGenBrakingAgent.py index 7f49d62..a167e65 100644 --- a/examples/Kundur_2area_dynamic_breaking/trainKundur2areaGenBrakingAgent.py +++ b/examples/Kundur_2area_dynamic_breaking/trainKundur2areaGenBrakingAgent.py @@ -24,7 +24,7 @@ # config the RLGC Java Sever java_port = 25002 -jar_file = '/lib/RLGCJavaServer1.0.0_alpha.jar' +jar_file = '/lib/RLGCJavaServer1.0.0_rc.jar' repo_path = os.path.abspath('.') diff --git a/examples/Kundur_2area_dynamic_breaking/trainedModels/Kundur_2area_dyn_breaking_DQN_lr_5e-05_totsteps_1500.pkl b/examples/Kundur_2area_dynamic_breaking/trainedModels/Kundur_2area_dyn_breaking_DQN_lr_5e-05_totsteps_1500.pkl index ee00ab7..160606c 100644 Binary files a/examples/Kundur_2area_dynamic_breaking/trainedModels/Kundur_2area_dyn_breaking_DQN_lr_5e-05_totsteps_1500.pkl and b/examples/Kundur_2area_dynamic_breaking/trainedModels/Kundur_2area_dyn_breaking_DQN_lr_5e-05_totsteps_1500.pkl differ diff --git a/lib/RLGCJavaServer0.87.jar b/lib/RLGCJavaServer0.87.jar deleted file mode 100644 index 31c0efb..0000000 Binary files a/lib/RLGCJavaServer0.87.jar and /dev/null differ diff --git a/lib/RLGCJavaServer0.88.jar b/lib/RLGCJavaServer0.88.jar deleted file mode 100644 index 1c750c0..0000000 Binary files a/lib/RLGCJavaServer0.88.jar and /dev/null differ diff --git a/lib/RLGCJavaServer0.89.jar b/lib/RLGCJavaServer0.89.jar deleted file mode 100644 index c60b448..0000000 Binary files a/lib/RLGCJavaServer0.89.jar and /dev/null differ diff --git a/lib/RLGCJavaServer0.91.jar b/lib/RLGCJavaServer0.91.jar deleted file mode 100644 index 368dfdd..0000000 Binary files a/lib/RLGCJavaServer0.91.jar and /dev/null differ diff --git a/lib/RLGCJavaServer0.92.jar b/lib/RLGCJavaServer0.92.jar deleted file mode 100644 index 94395f4..0000000 Binary files a/lib/RLGCJavaServer0.92.jar and /dev/null differ diff --git a/lib/RLGCJavaServer0.90.jar b/lib/RLGCJavaServer1.0.0_rc.jar similarity index 85% rename from lib/RLGCJavaServer0.90.jar rename to lib/RLGCJavaServer1.0.0_rc.jar index 16ec545..c122d80 100644 Binary files a/lib/RLGCJavaServer0.90.jar and b/lib/RLGCJavaServer1.0.0_rc.jar differ diff --git a/src/org/pnnl/gov/pss_gateway/IpssPyGateway.java b/src/org/pnnl/gov/pss_gateway/IpssPyGateway.java index 4048234..f10caf0 100644 --- a/src/org/pnnl/gov/pss_gateway/IpssPyGateway.java +++ b/src/org/pnnl/gov/pss_gateway/IpssPyGateway.java @@ -65,6 +65,7 @@ import com.interpss.dstab.cache.StateMonitor; import com.interpss.simu.SimuContext; import com.interpss.simu.SimuCtxType; +import java.util.Collections; import py4j.GatewayServer; @@ -241,8 +242,9 @@ else if (dynSimConfigBean!=null) { } } - System.out.println("\nImported power flow base case files:"); - System.out.println(Arrays.toString(baseCaseFiles.toArray())+"\n"); + Collections.sort(baseCaseFiles); //sort in ascending order; + + IpssLogger.getLogger().info("Imported power flow base case files:\n"+Arrays.toString(baseCaseFiles.toArray())+"\n"); isFirstInit = false; } @@ -774,8 +776,8 @@ public int[] reset(int caseIdx,int faultBusIdx, double faultStartTime, double fa caseInputFiles[0] = baseCaseFiles.get(caseIdx); } else { - IpssLogger.getLogger().severe("Error in the caseIdx in reset() function inpute, caseIdx < number of cases. caseIdx ="+caseIdx+", # of total cases ="+baseCaseFiles.size()+". Will use the first base case."); - caseInputFiles[0] = baseCaseFiles.get(0); + throw new Error("Error in the caseIdx in reset() function inpute, caseIdx must be less than number of cases. However, caseIdx ="+caseIdx+", # of total cases ="+baseCaseFiles.size()); + } @@ -791,13 +793,13 @@ public int[] reset(int caseIdx,int faultBusIdx, double faultStartTime, double fa this.faultBusId = this.rlConfigBean.faultBusCandidates[faultBusIdx]; if (this.dsNet.getBus(this.faultBusId)==null) { this.faultBusId= null; - IpssLogger.getLogger().severe("Error in the faultBusId in faultBusCandidates list in RL json configure file, index="+faultBusIdx); + throw new Error(("Error in the faultBusId in faultBusCandidates list in RL json configure file, index="+faultBusIdx)); } } else { - IpssLogger.getLogger().severe("The faultBusIdx is outside the faultBusCandidates list defined in RL json configure file!"); - this.faultBusId= null; + throw new Error(("The faultBusIdx is outside the faultBusCandidates list defined in RL json configure file!")); + } if (this.faultBusId!= null && faultStartTime>= 0.0 && faultDuration > 0.0){ @@ -808,7 +810,7 @@ public int[] reset(int caseIdx,int faultBusIdx, double faultStartTime, double fa this.faultDuration = 0.0; } - System.out.println(String.format("Case id: %d, Fault bus id: %s, fault start time: %f, fault duration: %f", caseIdx, faultBusId,faultStartTime,faultDuration)); + IpssLogger.getLogger().info(String.format("Case id: %d, Fault bus id: %s, fault start time: %f, fault duration: %f", caseIdx, faultBusId,faultStartTime,faultDuration)); return initDimAry; @@ -1664,10 +1666,14 @@ public void setLoadStatus(int busNum, String loadId, int status) { } public void setLoggerLevel(int level) { - if(level>=2) { + if(level>2) { IpssLogger.getLogger().setLevel(Level.FINE); ODMLogger.getLogger().setLevel(Level.FINE); } + if(level==2) { + IpssLogger.getLogger().setLevel(Level.INFO); + ODMLogger.getLogger().setLevel(Level.INFO); + } else if(level==1) { IpssLogger.getLogger().setLevel(Level.WARNING); ODMLogger.getLogger().setLevel(Level.WARNING); @@ -1713,7 +1719,7 @@ else if(logLevel==1) { GatewayServer server = new GatewayServer(app,port); - System.out.println("InterPSS Engine for Reinforcement Learning (IPSS-RL) developed by Qiuhua Huang @ PNNL. Version 1.0.0(BETA), built on 9/18/2020"); + System.out.println("InterPSS Engine for Reinforcement Learning (IPSS-RL) developed by Qiuhua Huang @ PNNL. Version 1.0.0_rc, built on 12/14/2020"); System.out.println("Starting Py4J " + app.getClass().getTypeName() + " at port ="+port); server.start(); diff --git a/src/org/pnnl/gov/test/DStab_IEEE300Bus_Test.java b/src/org/pnnl/gov/test/DStab_IEEE300Bus_Test.java index e7b4ca0..2824e3b 100644 --- a/src/org/pnnl/gov/test/DStab_IEEE300Bus_Test.java +++ b/src/org/pnnl/gov/test/DStab_IEEE300Bus_Test.java @@ -82,7 +82,7 @@ public void test_IEEE300_Dstab() throws InterpssException{ System.out.println(AclfOutFunc.loadFlowSummary(dsNet)); dstabAlgo.setSimuMethod(DynamicSimuMethod.MODIFIED_EULER); - dstabAlgo.setSimuStepSec(0.002); + dstabAlgo.setSimuStepSec(0.005); dstabAlgo.setTotalSimuTimeSec(5.0); //dstabAlgo.setRefMachine(dsNet.getMachine("Bus10030-mach1")); @@ -94,12 +94,12 @@ public void test_IEEE300_Dstab() throws InterpssException{ // set the output handler dstabAlgo.setSimuOutputHandler(sm); - dstabAlgo.setOutPutPerSteps(25); + dstabAlgo.setOutPutPerSteps(5); //dstabAlgo.setRefMachine(dsNet.getMachine("Bus39-mach1")); - IpssLogger.getLogger().setLevel(Level.INFO); + IpssLogger.getLogger().setLevel(Level.WARNING); - dsNet.addDynamicEvent(DStabObjectFactory.createBusFaultEvent("Bus20",dsNet,SimpleFaultCode.GROUND_3P,new Complex(0,0),null,0.0d,0.08),"3phaseFault@Bus20"); + dsNet.addDynamicEvent(DStabObjectFactory.createBusFaultEvent("Bus20",dsNet,SimpleFaultCode.GROUND_3P,new Complex(0,0),null,1.0d,0.08),"3phaseFault@Bus20"); if (dstabAlgo.initialization()) { @@ -120,14 +120,14 @@ public void test_IEEE300_Dstab() throws InterpssException{ } - //@Test + @Test public void test_IEEE300_Dstab_compositeLoadModel() throws InterpssException{ IpssCorePlugin.init(); IpssLogger.getLogger().setLevel(Level.WARNING); PSSEAdapter adapter = new PSSEAdapter(PsseVersion.PSSE_30); assertTrue(adapter.parseInputFile(NetType.DStabNet, new String[]{ - "testData/IEEE300/IEEE300Bus_modified_noHVDC.raw", - "testData/IEEE300/IEEE300_dyn_v2_cmld.dyr" + "testData/IEEE300/IEEE300Bus_modified_noHVDC_v2.raw", + "testData/IEEE300/IEEE300_dyn_cmld_zone1.dyr" })); DStabModelParser parser =(DStabModelParser) adapter.getModel(); @@ -157,8 +157,8 @@ public void test_IEEE300_Dstab_compositeLoadModel() throws InterpssException{ System.out.println(AclfOutFunc.loadFlowSummary(dsNet)); dstabAlgo.setSimuMethod(DynamicSimuMethod.MODIFIED_EULER); - dstabAlgo.setSimuStepSec(0.002); - dstabAlgo.setTotalSimuTimeSec(5.0); + dstabAlgo.setSimuStepSec(0.005); + dstabAlgo.setTotalSimuTimeSec(20.0); //dstabAlgo.setRefMachine(dsNet.getMachine("Bus10030-mach1")); @@ -402,7 +402,7 @@ public void test_IEEE300_loadshedding_RL_continuous_moreActionBuses() { } - @Test + //@Test public void test_IEEE300_loadshedding_RL_continuous_3zones() { IpssPyGateway app = new IpssPyGateway(); diff --git a/src/org/pnnl/gov/test/Dstab_Texas2000Bus_Test.java b/src/org/pnnl/gov/test/Dstab_Texas2000Bus_Test.java index 7213d29..691362b 100644 --- a/src/org/pnnl/gov/test/Dstab_Texas2000Bus_Test.java +++ b/src/org/pnnl/gov/test/Dstab_Texas2000Bus_Test.java @@ -89,7 +89,7 @@ public void test_Texas2000_loadshedding_RL_continuous() { if(app.getDStabAlgo().getSimuTime()<0.1) app.nextStepDynSim(0.1, new double[69], "continuous"); - else if(i<15) { + else if(i<4) { app.nextStepDynSim(0.1, actions, "continuous"); i++; } diff --git a/src/org/pnnl/gov/test/TestRandomBaseCaseSelection.java b/src/org/pnnl/gov/test/TestRandomBaseCaseSelection.java index 9091837..2d0a7e1 100644 --- a/src/org/pnnl/gov/test/TestRandomBaseCaseSelection.java +++ b/src/org/pnnl/gov/test/TestRandomBaseCaseSelection.java @@ -15,8 +15,9 @@ public class TestRandomBaseCaseSelection { public void test_with_IEEE39_RL() { - IpssLogger.getLogger().setLevel(Level.ALL); + IpssLogger.getLogger().setLevel(Level.FINE); IpssPyGateway app = new IpssPyGateway(); + app.setLoggerLevel(0); String[] caseFiles = new String[]{ "testData\\IEEE39\\IEEE39bus_multiloads_xfmr4_smallX_v30.raw", @@ -42,7 +43,7 @@ public void test_with_IEEE39_RL() { } //reset to different case Idx - app.reset(7, 3, 0.05, 0.08); + app.reset(5, 0, 0.05, 0.08); while(!app.isSimulationDone()) { diff --git a/src/scripts/testScripts/Test_env_creation_with_jar.py b/src/scripts/testScripts/Test_env_creation_with_jar.py index a2c8e5c..cbcaaf7 100644 --- a/src/scripts/testScripts/Test_env_creation_with_jar.py +++ b/src/scripts/testScripts/Test_env_creation_with_jar.py @@ -6,7 +6,7 @@ # config the RLGC Java Sever java_port = 25003 -jar_file = '/lib/RLGCJavaServer1.0.0_alpha.jar' +jar_file = '/lib/RLGCJavaServer1.0.0_rc.jar' repo_path = os.path.abspath('.') diff --git a/src/scripts/testScripts/test_PowerDynSimEnv_v7_continuous_action.py b/src/scripts/testScripts/test_PowerDynSimEnv_v7_continuous_action.py index eaf56dc..dfced2f 100644 --- a/src/scripts/testScripts/test_PowerDynSimEnv_v7_continuous_action.py +++ b/src/scripts/testScripts/test_PowerDynSimEnv_v7_continuous_action.py @@ -4,7 +4,7 @@ java_port = 25337 -jar_file = '/lib/RLGCJavaServer1.0.0_alpha.jar' +jar_file = '/lib/RLGCJavaServer1.0.0_rc.jar' repo_path = os.path.abspath('.') diff --git a/src/scripts/testScripts/test_loadShed_3motor_3levels.py b/src/scripts/testScripts/test_loadShed_3motor_3levels.py index 00bf3d3..345fc54 100644 --- a/src/scripts/testScripts/test_loadShed_3motor_3levels.py +++ b/src/scripts/testScripts/test_loadShed_3motor_3levels.py @@ -30,7 +30,7 @@ def manual_test(): java_port = 25335 -jar_file = '/lib/RLGCJavaServer1.0.0_alpha.jar' +jar_file = '/lib/RLGCJavaServer1.0.0_rc.jar' repo_path = os.path.abspath('.') @@ -69,7 +69,7 @@ def manual_test(): import sys sys.path.insert(0, './src/environments') -from PowerDynSimEnvDef_v5 import PowerDynSimEnv +from PowerDynSimEnvDef_v7 import PowerDynSimEnv env = PowerDynSimEnv(case_files_array,dyn_config_file,rl_config_file,jar_path,java_port) diff --git a/testData/IEEE39/json/IEEE39_RL_loadShedding_3motor_3levels.json b/testData/IEEE39/json/IEEE39_RL_loadShedding_3motor_3levels.json index 4ed1b40..43dce06 100644 --- a/testData/IEEE39/json/IEEE39_RL_loadShedding_3motor_3levels.json +++ b/testData/IEEE39/json/IEEE39_RL_loadShedding_3motor_3levels.json @@ -36,7 +36,7 @@ "maxVoltRecoveryTime":3.0, - "faultBusCandidates": ["Bus4"], + "faultBusCandidates": ["Bus7"], "faultStartTimeCandidates": [0.05], diff --git a/testData/Kundur-2area/json/kundur2area_RL_config.json b/testData/Kundur-2area/json/kundur2area_RL_config.json index 3818bd5..38e3751 100644 --- a/testData/Kundur-2area/json/kundur2area_RL_config.json +++ b/testData/Kundur-2area/json/kundur2area_RL_config.json @@ -22,6 +22,12 @@ "unstableReward": -1000, - "actionPenalty": 2.0 + "actionPenalty": 2.0, + + "faultBusCandidates": ["Bus6", "Bus7"], + + "faultStartTimeCandidates": [0.05], + + "faultDurationCandidates": [0.0, 0.05, 0.08] }