Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
Null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
skuloth committed Mar 17, 2016
1 parent c0b3872 commit 9909e6f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ public void run(){
double oldzVal;
double diffzVal;


/*
* Analysis loop
*
* Each run through the loop is analyzing the data in a new segment
* Trying to determine whether or not the condition is met for that period
* of time.
*/

while(!this.interrupted()){
requestSegment();

Expand All @@ -31,7 +40,6 @@ public void run(){
warn();
}
}

}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package edu.rit.se.beepbrake.DecisionMaking;

//created by RyanBega 2/8/16
//created by Ryan 2/8/16


import edu.rit.se.beepbrake.buffer.BufferManager;
Expand All @@ -13,11 +13,13 @@ public CameraDecision(DecisionManager decMan, BufferManager bufMan){
}

public void run(){
// while(!this.interrupted()){
// requestSegment();
//
// //Analysis loop
// }

//Analysis loop
while(!this.interrupted()){
requestSegment();

//Analysis
}
}

private void warn(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ protected boolean requestSegment(){
try {
while (true) {
requested = bufMan.getNewestSegment();
if (requested != null && (curSeg == null ||
curSeg.getCreatedAt() < requested.getCreatedAt())) {
if (requested != null && (curSeg == null || curSeg.getCreatedAt() < requested.getCreatedAt())) {
curSeg = requested;
return true;
}
Expand Down

0 comments on commit 9909e6f

Please sign in to comment.