Main Page
Namespaces
Classes
Files
File List
File Members
libism
ISM
common_type
Track.cpp
Go to the documentation of this file.
1
18
#include "
Tracks.hpp
"
19
#include <math.h>
20
21
namespace
ISM
{
22
void
Track::calculateWeight
() {
23
double
sum = 0;
24
int
count = 0;
25
for
(
ObjectPtr
& obj : this->
objects
) {
26
if
(obj) {
27
sum += obj->weight;
28
count++;
29
}
30
}
31
32
this->
weight
= floor((sum / (
double
)count) + 0.5);
33
}
34
35
std::ostream&
operator<<
(std::ostream &strm,
const
ISM::Track
&o)
36
{
37
strm <<
"Type: "
<< o.
type
<< std::endl
38
<<
"ObservedId: "
<< o.
observedId
<< std::endl
39
<<
"Weight: "
<< o.
weight
<< std::endl;
40
strm <<
"Objects :"
<< std::endl;
41
for
(
const
ObjectPtr
& ob : o.
objects
)
42
{
43
strm << ob << std::endl;
44
}
45
46
return
strm;
47
}
48
49
std::ostream&
operator<<
(std::ostream &strm,
const
ISM::TrackPtr
&o)
50
{
51
return
strm << (*o);
52
}
53
}
Tracks.hpp
ISM::Track::weight
double weight
Definition:
Track.hpp:34
ISM::Track::type
std::string type
Definition:
Track.hpp:31
ISM::operator<<
std::ostream & operator<<(std::ostream &strm, const ISM::ObjectRelation &r)
Definition:
ObjectRelation.cpp:167
ISM::Track::observedId
std::string observedId
Definition:
Track.hpp:32
ISM::Track
Definition:
Track.hpp:30
ISM::Track::calculateWeight
void calculateWeight()
Definition:
Track.cpp:22
ISM::TrackPtr
boost::shared_ptr< Track > TrackPtr
Definition:
Track.hpp:55
ISM
this namespace contains all generally usable classes.
Definition:
AcceptanceFunction.hpp:22
ISM::Track::objects
std::vector< ObjectPtr > objects
Definition:
Track.hpp:33
ISM::ObjectPtr
boost::shared_ptr< Object > ObjectPtr
Definition:
Object.hpp:82
asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:41