Skip to content

Commit

Permalink
Added support for extended experiments in figureS2. Made absolute pat…
Browse files Browse the repository at this point in the history
…hs explicit they need to be set by a user in notebooks and utility functions
  • Loading branch information
treyra committed Jul 29, 2024
1 parent e6ed869 commit 69727ac
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 33 deletions.
24 changes: 12 additions & 12 deletions failurePy/visualization/figure5andFigureS3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@
],
"source": [
"#Binary Easy.\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figure5/binaryProximityOperations\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figure5/binaryProximityOperations\"\n",
"fixedSafetyData = loadAndComputeSafetyData(experimentPath,[\"SFEAST\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False)\n",
"\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figure5/binaryProximityOperationsBaselines\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figure5/binaryProximityOperationsBaselines\"\n",
"Baselines = loadAndComputeSafetyData(experimentPath,[\"greedy\",\"cbf\",\"scp\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False)\n",
"\n",
"timeSteps = onp.arange(fixedSafetyData[\"numTimeSteps\"])\n",
Expand Down Expand Up @@ -134,10 +134,10 @@
],
"source": [
"#Binary Hard\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figure5/binaryAdverseCrashCourse\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figure5/binaryAdverseCrashCourse\"\n",
"fixedSafetyData = loadAndComputeSafetyData(experimentPath,[\"SFEAST\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False)\n",
"\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figure5/binaryAdverseCrashCourseBaselines\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figure5/binaryAdverseCrashCourseBaselines\"\n",
"Baselines = loadAndComputeSafetyData(experimentPath,[\"greedy\",\"cbf\",\"scp\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False)\n",
"\n",
"timeSteps = onp.arange(fixedSafetyData[\"numTimeSteps\"])\n",
Expand Down Expand Up @@ -187,12 +187,12 @@
],
"source": [
"#General Easy\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figure5/generalProximityOperations\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figure5/generalProximityOperations\"\n",
"\n",
"\n",
"fixedSafetyData = loadAndComputeSafetyData(experimentPath,[\"SFEAST\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False,requestedTSteps=15)\n",
"\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figure5/generalProximityOperationsBaselines\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figure5/generalProximityOperationsBaselines\"\n",
"Baselines = loadAndComputeSafetyData(experimentPath,[\"greedy\",\"cbf\",\"scp\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False,requestedTSteps=15)\n",
"\n",
"timeSteps = onp.arange(fixedSafetyData[\"numTimeSteps\"])\n",
Expand Down Expand Up @@ -242,11 +242,11 @@
],
"source": [
"#General Hard\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figure5/generalAdverseCrashCourse\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figure5/generalAdverseCrashCourse\"\n",
"\n",
"fixedSafetyData = loadAndComputeSafetyData(experimentPath,[\"SFEAST\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False,requestedTSteps=15)\n",
"\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figure5/generalAdverseCrashCourseBaselines\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figure5/generalAdverseCrashCourseBaselines\"\n",
"Baselines = loadAndComputeSafetyData(experimentPath,[\"greedy\",\"cbf\",\"scp\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False,requestedTSteps=15)\n",
"\n",
"timeSteps = onp.arange(fixedSafetyData[\"numTimeSteps\"])\n",
Expand Down Expand Up @@ -304,10 +304,10 @@
],
"source": [
"#Binary Medium\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figureS3/binaryRandomCrashCourse\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figureS3/binaryRandomCrashCourse\"\n",
"fixedSafetyData = loadAndComputeSafetyData(experimentPath,[\"SFEAST\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False)\n",
"\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figureS3/binaryRandomCrashCourseBaselines\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figureS3/binaryRandomCrashCourseBaselines\"\n",
"Baselines = loadAndComputeSafetyData(experimentPath,[\"greedy\",\"cbf\",\"scp\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False)\n",
"\n",
"timeSteps = onp.arange(fixedSafetyData[\"numTimeSteps\"])\n",
Expand Down Expand Up @@ -356,10 +356,10 @@
],
"source": [
"#General Medium\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figureS3/generalRandomCrashCourse\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figureS3/generalRandomCrashCourse\"\n",
"fixedSafetyData = loadAndComputeSafetyData(experimentPath,[\"SFEAST\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False)\n",
"\n",
"experimentPath = \"/home/trey/Research-Code/s-FEAST/failurePy/SavedData/figureS3/generalRandomCrashCourseBaselines\"\n",
"experimentPath = \"SET_AS_ABS_PATH_TO_failurePy/SavedData/figureS3/generalRandomCrashCourseBaselines\"\n",
"Baselines = loadAndComputeSafetyData(experimentPath,[\"greedy\",\"cbf\",\"scp\"],dieAndStayDead=True, sampleBeliefFlag=True,clearCachedData=False)\n",
"\n",
"timeSteps = onp.arange(fixedSafetyData[\"numTimeSteps\"])\n",
Expand Down
50 changes: 32 additions & 18 deletions failurePy/visualization/figuresS1andS2.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions failurePy/visualization/renderBeliefVideo.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,6 @@ def autoLabel(barPlotRectangles,ax): #ax is used a lot with matplotlib so pylint

#If running directly
if __name__ == "__main__":
SAVED_DATA_DIR_PATH = "/home/trey/Documents/SimLogs/simulation/SavedData/"
SAVED_DATA_DIR_PATH = None # SET TO PATH OF EXPERIMENT TO RENDER

main(SAVED_DATA_DIR_PATH,experimentName="12 movie 5",solverName="realTimeSFEAST",nSimulationsPerTree=100,outputPath="/home/trey/Documents/BeliefVisualization",outputSubDirectory="TimeSeries")
main(SAVED_DATA_DIR_PATH,experimentName="12 movie 5",solverName="realTimeSFEAST",nSimulationsPerTree=100,outputPath="SET_AS_ABS_PATH_TO_DESIRED_OUTPUT_DIRECTORY",outputSubDirectory="TimeSeries")
2 changes: 1 addition & 1 deletion failurePy/visualization/renderSavedRun.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ def main(savedDataDirPath,experimentName,outputPath):
#If running directly
if __name__ == "__main__":
SAVED_DATA_DIR_PATH = None #SET THIS BEFORE RUNNING!
main(SAVED_DATA_DIR_PATH,experimentName="hardwareSafetyTest",outputPath="/home/trey/Documents/TrialVisualization")
main(SAVED_DATA_DIR_PATH,experimentName="hardwareSafetyTest",outputPath="SET_AS_ABS_PATH_TO_DESIRED_OUTPUT_DIRECTORY")

0 comments on commit 69727ac

Please sign in to comment.