Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PerformancePlotter TRIAL_AVERAGES_ONLY Mode #141

Open
GeigerDavin opened this issue Nov 25, 2016 · 0 comments
Open

PerformancePlotter TRIAL_AVERAGES_ONLY Mode #141

GeigerDavin opened this issue Nov 25, 2016 · 0 comments

Comments

@GeigerDavin
Copy link

If you run the experimentAndPlotter function from

burlap_examples/src/main/java/edu/brown/cs/burlap/tutorials/BasicBehavior.java

and change the TrialMode from MOST_RECENT_AND_AVERAGE to TRIAL_AVERAGES_ONLY (line 261)

exp.setUpPlottingConfiguration(500, 250, 2, 1000,
				TrialMode.TRIAL_AVERAGES_ONLY,
				PerformanceMetric.CUMULATIVE_STEPS_PER_EPISODE,
				PerformanceMetric.AVERAGE_EPISODE_REWARD);

The Program get stucked.
I think this is because PerformancePlotter only notifies that one trial is complete if the Trial Mode is MOST_RECENT_TRIAL_ONLY or MOST_RECENT_AND_AVERAGE. This can be found in the updateTimeSeries function of the PerformancePlotter class (line 753).
So maybe this function should look like this?

	synchronized protected void updateTimeSeries(){
		
		SwingUtilities.invokeLater(new Runnable() {
			
			public void run() {

				synchronized (WorkingPerformancePlotter.this) {
						
					synchronized (WorkingPerformancePlotter.this.trialUpdateComplete) {
							
						if(WorkingPerformancePlotter.this.trialMode.mostRecentTrialEnabled()){
								
							if(WorkingPerformancePlotter.this.needsClearing){
								WorkingPerformancePlotter.this.curAgentDatasets.clearNonAverages();
								WorkingPerformancePlotter.this.needsClearing = false;
							}
							
							if(WorkingPerformancePlotter.this.curTimeStep > WorkingPerformancePlotter.this.lastTimeStepUpdate){
								WorkingPerformancePlotter.this.updateCSRSeries();
								WorkingPerformancePlotter.this.lastTimeStepUpdate = curTimeStep;
							}
							if(WorkingPerformancePlotter.this.curEpisode > WorkingPerformancePlotter.this.lastEpisode){
								WorkingPerformancePlotter.this.updateCERSeries();
								WorkingPerformancePlotter.this.updateAERSeris();
								WorkingPerformancePlotter.this.updateMERSeris();
								WorkingPerformancePlotter.this.updateCSESeries();
								WorkingPerformancePlotter.this.updateSESeries();
								
								WorkingPerformancePlotter.this.lastEpisode = WorkingPerformancePlotter.this.curEpisode;
							}
						}
						
						WorkingPerformancePlotter.this.trialUpdateComplete.b = true;
						WorkingPerformancePlotter.this.trialUpdateComplete.notifyAll();
					}
				}
				
				
				
			}
		});
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant