Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gauthier Quesnel
irritator
Commits
eb505273
Commit
eb505273
authored
Jun 15, 2020
by
K-H-Ismail
Committed by
Gauthier Quesnel
Jul 02, 2020
Browse files
core: add adptive threshold to cross model ports
parent
d2b4c328
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/include/irritator/core.hpp
View file @
eb505273
...
...
@@ -4611,7 +4611,7 @@ struct accumulator
struct
cross
{
model_id
id
;
input_port_id
x
[
3
];
input_port_id
x
[
4
];
output_port_id
y
[
2
];
time
sigma
;
...
...
@@ -4628,7 +4628,8 @@ struct cross
{
port_value
,
port_if_value
,
port_else_value
port_else_value
,
port_threshold
};
status
initialize
(
data_array
<
message
,
message_id
>&
/*init*/
)
noexcept
...
...
@@ -4653,6 +4654,17 @@ struct cross
bool
have_message
=
false
;
bool
have_message_value
=
false
;
for
(
const
auto
&
msg
:
input_ports
.
get
(
x
[
port_threshold
]).
messages
)
{
irt_return_if_fail
(
msg
.
type
==
value_type
::
real_64
,
status
::
model_cross_bad_external_message
);
irt_return_if_fail
(
msg
.
size
()
==
1
,
status
::
model_cross_bad_external_message
);
threshold
=
msg
.
to_real_64
(
0
);
have_message
=
true
;
}
for
(
const
auto
&
msg
:
input_ports
.
get
(
x
[
port_value
]).
messages
)
{
irt_return_if_fail
(
msg
.
type
==
value_type
::
real_64
,
status
::
model_cross_bad_external_message
);
...
...
Write
Preview
Markdown
is supported
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