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
Franck Dary
macaon
Commits
f71baac6
Commit
f71baac6
authored
Apr 16, 2022
by
Franck Dary
Browse files
Only update stack_dist and stack_size when on state parser
parent
4818cfc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
reading_machine/src/Transition.cpp
View file @
f71baac6
...
...
@@ -101,14 +101,14 @@ void Transition::apply(Config & config, float entropy)
{
if
(
config
.
hasColIndex
(
"STACK_SIZE"
))
{
auto
&
curValue
=
config
.
get
(
"STACK_SIZE"
,
config
.
getWordIndex
()
,
0
);
if
(
std
::
string
(
curValue
).
empty
())
auto
&
curValue
=
config
.
get
LastNotEmptyHyp
(
"STACK_SIZE"
,
config
.
getWordIndex
());
if
(
std
::
string
(
curValue
).
empty
()
and
config
.
getState
()
==
"parser"
)
curValue
=
fmt
::
format
(
"{}"
,
config
.
getStackSize
());
}
if
(
config
.
hasColIndex
(
"STACK_DIST"
))
{
auto
&
curValue
=
config
.
get
(
"STACK_DIST"
,
config
.
getWordIndex
()
,
0
);
if
(
std
::
string
(
curValue
).
empty
())
auto
&
curValue
=
config
.
get
LastNotEmptyHyp
(
"STACK_DIST"
,
config
.
getWordIndex
());
if
(
std
::
string
(
curValue
).
empty
()
and
config
.
getState
()
==
"parser"
)
{
if
(
config
.
hasStack
(
0
)
and
config
.
hasStack
(
1
))
curValue
=
fmt
::
format
(
"{}"
,
config
.
getStack
(
0
)
-
config
.
getStack
(
1
));
...
...
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