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
979af079
Commit
979af079
authored
4 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
Update for new init call
parent
d9655a1a
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/SCD.m
+7
-4
7 additions, 4 deletions
code/classes/SCD.m
code/classes/SCDclass_algo.m
+6
-3
6 additions, 3 deletions
code/classes/SCDclass_algo.m
code/classes/SCDclass_expcode.m
+44
-45
44 additions, 45 deletions
code/classes/SCDclass_expcode.m
with
57 additions
and
52 deletions
code/classes/SCD.m
+
7
−
4
View file @
979af079
...
...
@@ -26,14 +26,17 @@ classdef SCD
H
.
setup
;
end
function
H
=
init
(
expcode
,
shot
)
assert
(
nargin
==
2
,
'must supply 2 inputs to init(expcode,shot)'
)
function
H
=
init
(
expcode
)
H
=
SCD
.
load
(
expcode
);
H
.
init
;
end
function
H
=
actualize
(
expcode
,
shot
)
H
=
SCD
.
load
(
expcode
);
H
.
setup
;
H
.
callinits
;
H
.
actualize
(
shot
);
end
function
help
()
help
(
mfilename
);
end
...
...
This diff is collapsed.
Click to expand it.
code/classes/SCDclass_algo.m
+
6
−
3
View file @
979af079
...
...
@@ -134,8 +134,11 @@ classdef SCDclass_algo
dd
=
obj
.
getdatadictionary
;
ddpath
=
fullfile
(
obj
.
folder
,
dd
);
% Close all open data dictionaries
Simulink
.
data
.
dictionary
.
closeAll
;
% Close close this model's data dictionary
if
contains
(
Simulink
.
data
.
dictionary
.
getOpenDictionaryPaths
,
dd
)
Simulink
.
data
.
dictionary
.
closeAll
(
dd
);
end
% Create if not existing already
if
isempty
(
which
(
ddpath
))
fprintf
(
'generating data dictionary %s\n'
,
fullfile
(
obj
.
folder
,
obj
.
getdatadictionary
));
...
...
@@ -330,7 +333,7 @@ classdef SCDclass_algo
fcnhandle
=
str2func
(
fcnhandle
);
end
assert
(
isa
(
fcnhandle
,
'function_handle'
),
'stdinit function must be a function handle'
);
assert
(
nargout
(
fcnhandle
)
=
=
0
,
'stdinit functions may not have output arguments'
)
assert
(
nargout
(
fcnhandle
)
<
=
0
,
'stdinit functions may not have output arguments'
)
obj
.
stdinits
{
end
+
1
}
=
fcnhandle
;
end
...
...
This diff is collapsed.
Click to expand it.
code/classes/SCDclass_expcode.m
+
44
−
45
View file @
979af079
...
...
@@ -327,11 +327,11 @@ classdef SCDclass_expcode
obj
.
taskcontainer
.
exectasksoninit
(
shot
);
end
function
call
init
s
(
obj
)
function
init
(
obj
)
if
(
~
isempty
(
obj
.
algoobjlist
))
for
ii
=
1
:
numel
(
obj
.
algoobjlist
)
if
nargin
==
1
obj
.
algoobjlist
{
ii
}
.
call
init
s
();
obj
.
algoobjlist
{
ii
}
.
init
();
elseif
nargin
==
2
error
(
'this use is deprecated, add tasks instead'
)
else
...
...
@@ -362,8 +362,7 @@ classdef SCDclass_expcode
fprintf
(
'Simulating %s.slx\n'
,
myslx
)
sim
(
myslx
)
end
function
build
(
obj
,
varargin
)
if
numel
(
varargin
)
==
0
...
...
@@ -413,41 +412,46 @@ classdef SCDclass_expcode
SCDclass_expcode
.
build_nodes
(
compileslx_list
);
end
end
%% Printing methods
%% Property access methods
function
nodes
=
getnodes
(
obj
)
nodes
=
obj
.
nodes
;
end
%% Printing methods
function
printinfo
(
obj
)
fprintf
(
'*****************************************************\n'
);
fprintf
(
'* SCD expcode:
''
%s
''
, main code: %d\n'
,
obj
.
name
,
obj
.
maincode
);
fprintf
(
'*****************************************************\n'
);
fprintf
(
'* Configured wrappers:\n'
)
if
(
numel
(
obj
.
wrapperlist
)
>
0
)
for
ii
=
1
:
numel
(
obj
.
wrapperlist
)
fprintf
(
' Node: %d, CPU: %d, varalgo: %d, wrapper:
''
%s
''
, datadict:
''
%s
''
\n'
,
...
obj
.
wrapperlist
{
ii
}{
1
},
...
obj
.
wrapperlist
{
ii
}{
2
},
...
obj
.
wrapperlist
{
ii
}{
3
},
...
obj
.
wrapperlist
{
ii
}{
4
},
...
obj
.
wrapperlist
{
ii
}{
5
}
...
);
end
end
fprintf
(
'* Configured algorithms:\n'
);
if
(
numel
(
obj
.
algonamelist
)
>
0
)
for
ii
=
1
:
numel
(
obj
.
algonamelist
),
fprintf
(
'
''
%s
''
\n'
,
char
(
obj
.
algonamelist
{
ii
}));
end
end
fprintf
(
'* Configured algorithm data dictionaries:\n'
)
if
(
numel
(
obj
.
algoddlist
)
>
0
)
for
ii
=
1
:
numel
(
obj
.
algoddlist
),
fprintf
(
'
''
%s
''
\n'
,
char
(
obj
.
algoddlist
{
ii
}));
end
end
fprintf
(
'* Configured exported tunparams structures:\n'
)
if
(
numel
(
obj
.
exportedtps
)
>
0
)
for
ii
=
1
:
numel
(
obj
.
exportedtps
),
fprintf
(
'
''
%s
''
\n'
,
char
(
obj
.
exportedtps
{
ii
}));
end
end
fprintf
(
'* Configured MDS tunparams objects: %d (use printparameters method for details)\n'
,
obj
.
mdscontainer
.
numparams
);
fprintf
(
'* Configured MDS wavegens objects: %d (use printwavegens method for details)\n'
,
obj
.
mdscontainer
.
numwavegens
);
fprintf
(
'* Configured general purpose tasks: %d (use printtasks method for details)\n'
,
obj
.
taskcontainer
.
numtasks
);
fprintf
(
'* Configured init scripts: %d (use printinits method for details)\n'
,
numel
(
obj
.
stdinits
));
fprintf
(
'*****************************************************\n'
);
fprintf
(
'* SCD expcode:
''
%s
''
, main code: %d\n'
,
obj
.
name
,
obj
.
maincode
);
fprintf
(
'*****************************************************\n'
);
fprintf
(
'* Configured wrappers:\n'
)
if
(
numel
(
obj
.
wrapperlist
)
>
0
)
for
ii
=
1
:
numel
(
obj
.
wrapperlist
)
fprintf
(
' Node: %d, CPU: %d, varalgo: %d, wrapper:
''
%s
''
, datadict:
''
%s
''
\n'
,
...
obj
.
wrapperlist
{
ii
}{
1
},
...
obj
.
wrapperlist
{
ii
}{
2
},
...
obj
.
wrapperlist
{
ii
}{
3
},
...
obj
.
wrapperlist
{
ii
}{
4
},
...
obj
.
wrapperlist
{
ii
}{
5
}
...
);
end
end
fprintf
(
'* Configured algorithms:\n'
);
if
(
numel
(
obj
.
algonamelist
)
>
0
)
for
ii
=
1
:
numel
(
obj
.
algonamelist
),
fprintf
(
'
''
%s
''
\n'
,
char
(
obj
.
algonamelist
{
ii
}));
end
end
fprintf
(
'* Configured algorithm data dictionaries:\n'
)
if
(
numel
(
obj
.
algoddlist
)
>
0
)
for
ii
=
1
:
numel
(
obj
.
algoddlist
),
fprintf
(
'
''
%s
''
\n'
,
char
(
obj
.
algoddlist
{
ii
}));
end
end
fprintf
(
'* Configured exported tunparams structures:\n'
)
if
(
numel
(
obj
.
exportedtps
)
>
0
)
for
ii
=
1
:
numel
(
obj
.
exportedtps
),
fprintf
(
'
''
%s
''
\n'
,
char
(
obj
.
exportedtps
{
ii
}));
end
end
fprintf
(
'* Configured MDS tunparams objects: %d (use printparameters method for details)\n'
,
obj
.
mdscontainer
.
numparams
);
fprintf
(
'* Configured MDS wavegens objects: %d (use printwavegens method for details)\n'
,
obj
.
mdscontainer
.
numwavegens
);
fprintf
(
'* Configured general purpose tasks: %d (use printtasks method for details)\n'
,
obj
.
taskcontainer
.
numtasks
);
fprintf
(
'* Configured init scripts: %d (use printinits method for details)\n'
,
numel
(
obj
.
stdinits
));
end
function
printtasks
(
obj
)
...
...
@@ -521,8 +525,7 @@ classdef SCDclass_expcode
function
printwavegens
(
obj
)
obj
.
mdscontainer
.
printwavegens
;
end
%% Configuration methods
function
obj
=
addwrapper
(
obj
,
inode
,
icpu
,
varalgo
,
wrappername
,
varargin
)
...
...
@@ -771,8 +774,7 @@ classdef SCDclass_expcode
evalin
(
'base'
,
'clear temp;'
);
end
function
obj
=
setupwrapdd
(
obj
)
% Sets up the data dictionaries of the wrappers to be loaded
% on the nodes inside the main tcv.sldd
...
...
@@ -1099,8 +1101,6 @@ classdef SCDclass_expcode
obj
.
actualizewavegens
(
shot
);
end
function
actualizeparameters
(
obj
,
shot
)
obj
.
mdscontainer
.
modeltoactualize
=
obj
.
modeltoactualize
;
obj
.
mdscontainer
.
actualizeparameters
(
shot
);
...
...
@@ -1112,7 +1112,6 @@ classdef SCDclass_expcode
end
%% MDS update methods
function
updatemds
(
obj
,
algo
,
shot
)
if
shot
~=-
1
error
(
'SCDclass_expcode:updatemds'
,
'update permitted only on the model shot'
);
...
...
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