Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCDDS-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPC
SCDDS
SCDDS-core
Commits
aa79bb87
Commit
aa79bb87
authored
5 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
Add methods for compiling and simulating algo and expcode
parent
546fd9a6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
code/classes/SCDclass_algo.m
+14
-0
14 additions, 0 deletions
code/classes/SCDclass_algo.m
code/classes/SCDclass_expcode.m
+10
-1
10 additions, 1 deletion
code/classes/SCDclass_expcode.m
tests/test_expcodes.m
+9
-8
9 additions, 8 deletions
tests/test_expcodes.m
with
33 additions
and
9 deletions
code/classes/SCDclass_algo.m
+
14
−
0
View file @
aa79bb87
...
...
@@ -296,6 +296,20 @@ classdef SCDclass_algo
end
end
function
compile
(
obj
)
try
eval
(
sprintf
(
'%s([],[],[],
''
compile
''
)'
,
obj
.
modelname
));
catch
eval
(
sprintf
(
'%s([],[],[],
''
term
''
)'
,
obj
.
modelname
));
end
eval
(
sprintf
(
'%s([],[],[],
''
term
''
)'
,
obj
.
modelname
));
end
function
sim
(
obj
)
sim
(
obj
.
modelname
);
end
end
end
This diff is collapsed.
Click to expand it.
code/classes/SCDclass_expcode.m
+
10
−
1
View file @
aa79bb87
...
...
@@ -531,7 +531,16 @@ classdef SCDclass_expcode
fprintf
(
" }\n"
);
fprintf
(
"}\n"
);
end
function
tcvcompile
(
obj
)
try
tcv
([],[],[],
'compile'
);
tcv
([],[],[],
'term'
);
catch
ME
tcv
([],[],[],
'term'
);
rethrow
(
ME
)
end
end
end
methods
(
Access
=
private
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_expcodes.m
+
9
−
8
View file @
aa79bb87
...
...
@@ -31,16 +31,17 @@ classdef test_expcodes < matlab.unittest.TestCase
end
methods
(
Test
)
function
test_callinits
(
testCase
)
testCase
.
expcode_obj
.
callinits
;
end
function
test_setup
(
testCase
)
testCase
.
expcode_obj
.
setup
;
% run setup this exp code
end
function
test_expcode
(
testCase
)
% attempt compiling tcv.slx for this expcode
try
tcv
([],[],[],
'compile'
);
tcv
([],[],[],
'term'
);
catch
ME
tcv
([],[],[],
'term'
);
rethrow
(
ME
)
end
testCase
.
assertTrue
(
true
);
% dummy
testCase
.
expcode_obj
.
tcvcompile
;
% compile tcv.slx with this expcode
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment