Commit 3a8291e5 authored by Alexis Lebis's avatar Alexis Lebis

fix m3tal/csdvp-evolutionary-alogirthm-optimization#3

Mostly due to a bad vector access in the overriden operator<<
parent a9494406
...@@ -234,10 +234,13 @@ std::ostream& operator<<(std::ostream& Stream, const Course & c) ...@@ -234,10 +234,13 @@ std::ostream& operator<<(std::ostream& Stream, const Course & c)
{ {
std::string s = "Course\n\tid:"+std::to_string(c.id())+"\n\tname:"+c.name()+"\n\tECTS: "+std::to_string(c.ects()); std::string s = "Course\n\tid:"+std::to_string(c.id())+"\n\tname:"+c.name()+"\n\tECTS: "+std::to_string(c.ects());
std::string tf; std::string tf;
if(c.timeFrame().size() > 0)
{
for(int i = 0; i < c.timeFrame().size()-1; i++) for(int i = 0; i < c.timeFrame().size()-1; i++)
tf+=std::to_string(c.timeFrame().at(i))+" ; "; tf+=std::to_string(c.timeFrame().at(i))+" ; ";
tf+=std::to_string(c.timeFrame().at(c.timeFrame().size()-1)); tf+=std::to_string(c.timeFrame().at(c.timeFrame().size()-1));
s+="\n\tTimeFrames: ["+tf+"]"; s+="\n\tTimeFrames: ["+tf+"]";
}
Stream << s; Stream << s;
return Stream; return Stream;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment