forked from cmansley/hoot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic logging capability to bicycle domain
- Loading branch information
Showing
6 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Code by Chris Mansley | ||
*/ | ||
#include "sars.hh" | ||
|
||
/*! | ||
* Output operator for the SARS class | ||
*/ | ||
std::ostream& operator<<(std::ostream &out, const SARS &sars) | ||
{ | ||
/* Print state */ | ||
for(State::const_iterator it = sars.s.begin(); it != sars.s.end(); ++it) { | ||
out << *it << ","; | ||
} | ||
|
||
/* Print action */ | ||
for(Action::const_iterator it = sars.a.begin(); it != sars.a.end(); ++it) { | ||
out << *it << ","; | ||
} | ||
|
||
/* Print reward */ | ||
out << sars.reward << ","; | ||
|
||
/* Print next state */ | ||
for(State::const_iterator it = sars.s_prime.begin(); it != sars.s_prime.end(); ++it) { | ||
out << *it << ","; | ||
} | ||
|
||
/* Print out terminal */ | ||
out << sars.terminal; | ||
|
||
return out; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters