Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITASimulationScheduler
Commits
e8f55de4
Commit
e8f55de4
authored
Jun 21, 2020
by
Pascal Palenda
Browse files
Adapt scheduler to filter network - WIP
parent
88febc59
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ITA/simulation_scheduler/scheduler.h
View file @
e8f55de4
...
...
@@ -135,15 +135,15 @@ namespace ITA
/// However, it could also be useful in the long run.
/// \return a vector of pointers to the workers.
///
std
::
vector
<
IWorkerInterface
*>
getWorker
(
);
std
::
vector
<
IWorkerInterface
*>
getWorker
(
)
const
;
///
/// \brief Gets
a vector of
pointer
s
to the filter
s
.
/// \brief Gets pointer to the filter
network
.
/// \note This function is primarily for testing.
/// However, it could also be useful in the long run.
/// \return a
vector of
pointer
s
to the filter
s
.
/// \return a pointer to the filter
network
.
///
std
::
vector
<
audibility_filter
::
IAudibilityFilter
*>
getFilter
(
)
;
audibility_filter
::
CFilterNetwork
*
getFilterNetwork
(
)
const
;
private:
///
...
...
@@ -180,10 +180,9 @@ namespace ITA
std
::
vector
<
std
::
unique_ptr
<
IWorkerInterface
>>
m_vWorker
;
///
/// \brief List of the audibility filters belonging to CScheduler.
/// \remark The order of the filters matters, thus this is a std::list.
/// \brief Filter network of the CScheduler.
///
std
::
list
<
std
::
unique_ptr
<
audibility_filter
::
IAudibilityFilter
>>
m_lAudibilityFilters
;
std
::
unique_ptr
<
audibility_filter
::
CFilterNetwork
>
m_pFilterNetwork
;
///
/// \brief Concurrent queue to handle the input of new Updates.
...
...
src/ITA/simulation_scheduler/scheduler.cpp
View file @
e8f55de4
...
...
@@ -79,10 +79,7 @@ namespace ITA
m_vWorker
.
push_back
(
std
::
move
(
CWorkerFactory
::
createWorker
(
workerConfig
,
this
)
)
);
}
for
(
const
auto
&
workerConfig
:
workerConfigs
)
{
m_vWorker
.
push_back
(
std
::
move
(
CWorkerFactory
::
createWorker
(
workerConfig
,
this
)
)
);
}
m_pFilterNetwork
=
std
::
make_unique
<
audibility_filter
::
CFilterNetwork
>
(
pConfig
.
oFilterNetworkConfig
);
Run
(
);
}
...
...
@@ -136,13 +133,7 @@ namespace ITA
if
(
m_mPreviousStates
.
find
(
pUpdate
->
getReferenceID
(
)
)
!=
m_mPreviousStates
.
end
(
)
)
{
// Test if the update is audible.
// Note the extra condition in the for loop, this gains performance if a previous update indicates non audibility.
for
(
auto
&
filterIter
=
m_lAudibilityFilters
.
begin
(
);
bAudible
&&
filterIter
!=
m_lAudibilityFilters
.
end
(
);
++
filterIter
)
{
bAudible
&=
(
*
filterIter
)
->
changeIsAudible
(
*
m_mPreviousStates
.
at
(
pUpdate
->
getReferenceID
(
)
),
*
pUpdate
);
}
bAudible
=
m_pFilterNetwork
->
evaluateNetwork
(
*
m_mPreviousStates
.
at
(
pUpdate
->
getReferenceID
(
)
),
*
pUpdate
);
}
if
(
bAudible
)
...
...
@@ -264,7 +255,7 @@ namespace ITA
return
true
;
}
std
::
vector
<
IWorkerInterface
*>
CScheduler
::
getWorker
(
)
std
::
vector
<
IWorkerInterface
*>
CScheduler
::
getWorker
(
)
const
{
std
::
vector
<
IWorkerInterface
*>
vec
;
...
...
@@ -276,16 +267,9 @@ namespace ITA
return
vec
;
}
std
::
vector
<
audibility_filter
::
IAudibilityFilter
*>
CScheduler
::
getFilter
(
)
audibility_filter
::
CFilterNetwork
*
CScheduler
::
getFilter
Network
(
)
const
{
std
::
vector
<
audibility_filter
::
IAudibilityFilter
*>
vec
;
for
(
const
auto
&
filter
:
m_lAudibilityFilters
)
{
vec
.
push_back
(
filter
.
get
(
)
);
}
return
vec
;
return
m_pFilterNetwork
.
get
(
);
}
}
// namespace simulation_scheduler
}
// namespace ITA
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment