← Documentation
ADS-IDAC Engine 5.0.0
TimeRange.cpp
Go to the documentation of this file.
1// TimeRange.cpp: implementation of the TimeRange class.
2//
4
5#include "TimeRange.h"
6#include "ReasonMachine.h"
7using namespace std;
8
10// Construction/Destruction
12
14{
15 this->m_end_time = 0;
16 this->m_start_time = 0;
17 this->m_time_after = 0;
18 this->m_time_before = 0;
19}
20
22{
23
24}
25
27{
28 if(this->m_end_time != 0)
29 {
30 return this->m_end_time;
31 }
32 else
33 {
34 return this->m_time_before;
35 }
36}
37
39{
40 string time_info;
41 stringstream conv;
42
43 if(this->m_start_time != 0)
44 {
45 //fout << "<" << statement_pt->m_time_range.m_start_time << " , ";
46 time_info += "<";
47 conv.str("");
48 conv << this->m_start_time;
49 time_info += conv.str();
50
51 }
52 else
53 {
54 time_info += "(";
55 conv.str("");
56 conv << this->m_time_after;
57 time_info += conv.str();
58 }
59
60 time_info += " , ";
61
62 if(this->m_end_time != 0)
63 {
64 conv.str("");
65 conv << this->m_end_time;
66 time_info += conv.str();
67 time_info += ">";
68 }
69 else
70 {
71 conv.str("");
72 conv << this->m_time_after;
73 time_info += conv.str();
74 time_info += ")";
75 }
76 return time_info;
77}
78
80{
81 if(this->m_start_time != 0)
82 {
83 return this->m_start_time;
84 }
85 else
86 {
87 return this->m_time_after;
88 }
89}
90
92{
93 this->m_start_time = _TR.m_start_time;
94 this->m_end_time = _TR.m_end_time;
95 this->m_time_before = _TR.m_time_before;
96 this->m_time_after = _TR.m_time_after;
97}
Diagnostic reasoning engine — knowledge representation, mental model, and inference.
float GetTimeBoundEarlier()
Definition: TimeRange.cpp:79
float m_start_time
Definition: TimeRange.h:21
float m_time_before
Definition: TimeRange.h:19
std::string GetTimeInfoInString()
Definition: TimeRange.cpp:38
void CopyTimeRangeFromAnother(TimeRange &)
Definition: TimeRange.cpp:91
float m_time_after
Definition: TimeRange.h:18
float m_end_time
Definition: TimeRange.h:20
float GetTimeBoundLater()
Definition: TimeRange.cpp:26
virtual ~TimeRange()
Definition: TimeRange.cpp:21