Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
Distributed Autonomous Networked Control Lab
MicroCART
Commits
9b0fa285
Commit
9b0fa285
authored
7 years ago
by
Peter Thedens
Browse files
Options
Downloads
Patches
Plain Diff
revert to correct files
parent
106a96f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
quad/src/computation_graph/computation_graph.c
+6
-6
6 additions, 6 deletions
quad/src/computation_graph/computation_graph.c
quad/src/computation_graph/test/test_computation_graph.c
+12
-12
12 additions, 12 deletions
quad/src/computation_graph/test/test_computation_graph.c
with
18 additions
and
18 deletions
quad/src/computation_graph/computation_graph.c
+
6
−
6
View file @
9b0fa285
...
@@ -188,10 +188,10 @@ double graph_get_output(const struct computation_graph *graph, int node_id, int
...
@@ -188,10 +188,10 @@ double graph_get_output(const struct computation_graph *graph, int node_id, int
* a valid node ID is passed in to the first call of this function
* a valid node ID is passed in to the first call of this function
*/
*/
void
graph_compute_node_rec
(
struct
computation_graph
*
graph
,
int
node_id
,
int
depth
)
{
void
graph_compute_node_rec
(
struct
computation_graph
*
graph
,
int
node_id
,
int
depth
)
{
//
if (depth >= GRAPH_MAX_DEPTH) {
if
(
depth
>=
GRAPH_MAX_DEPTH
)
{
//
assert(1 == 0);
assert
(
1
==
0
);
//
return;
return
;
//
}
}
// if (!graph_node_exists(graph, node_id)) {
// if (!graph_node_exists(graph, node_id)) {
// return;
// return;
// }
// }
...
@@ -199,7 +199,7 @@ void graph_compute_node_rec(struct computation_graph *graph, int node_id, int de
...
@@ -199,7 +199,7 @@ void graph_compute_node_rec(struct computation_graph *graph, int node_id, int de
if
(
node
->
processed_state
!=
UNPROCESSED
)
{
if
(
node
->
processed_state
!=
UNPROCESSED
)
{
return
;
return
;
}
}
//
node->processed_state = DISCOVERED;
node
->
processed_state
=
DISCOVERED
;
int
input_id
;
int
input_id
;
for
(
input_id
=
0
;
input_id
<
node
->
type
->
n_inputs
;
input_id
++
)
{
for
(
input_id
=
0
;
input_id
<
node
->
type
->
n_inputs
;
input_id
++
)
{
int
src_cntl_id
=
node
->
input_srcs
[
input_id
].
controller_id
;
int
src_cntl_id
=
node
->
input_srcs
[
input_id
].
controller_id
;
...
@@ -225,7 +225,7 @@ void graph_compute_node_rec(struct computation_graph *graph, int node_id, int de
...
@@ -225,7 +225,7 @@ void graph_compute_node_rec(struct computation_graph *graph, int node_id, int de
(
*
node
->
type
->
execute
)(
node
->
state
,
node
->
param_values
,
exec_input_vals
,
node
->
output_values
);
(
*
node
->
type
->
execute
)(
node
->
state
,
node
->
param_values
,
exec_input_vals
,
node
->
output_values
);
}
}
}
}
//
node->processed_state = PROCESSED;
node
->
processed_state
=
PROCESSED
;
}
}
void
graph_compute_nodes
(
struct
computation_graph
*
graph
,
int
*
node_ids
,
int
n_nodes
)
{
void
graph_compute_nodes
(
struct
computation_graph
*
graph
,
int
*
node_ids
,
int
n_nodes
)
{
...
...
This diff is collapsed.
Click to expand it.
quad/src/computation_graph/test/test_computation_graph.c
+
12
−
12
View file @
9b0fa285
...
@@ -241,18 +241,18 @@ void test_that_new_nodes_can_be_created_by_ID() {
...
@@ -241,18 +241,18 @@ void test_that_new_nodes_can_be_created_by_ID() {
int
main
()
{
int
main
()
{
UNITY_BEGIN
();
UNITY_BEGIN
();
//
RUN_TEST(test_adding_2_numbers);
RUN_TEST
(
test_adding_2_numbers
);
RUN_TEST
(
test_computing_cycles
);
RUN_TEST
(
test_computing_cycles
);
//
RUN_TEST(test_resetting_cycles);
RUN_TEST
(
test_resetting_cycles
);
//
RUN_TEST(test_accumulator_state);
RUN_TEST
(
test_accumulator_state
);
//
RUN_TEST(test_that_blocks_only_get_executed_once);
RUN_TEST
(
test_that_blocks_only_get_executed_once
);
//
RUN_TEST(tests_that_already_connected_blocks_dont_get_reset);
RUN_TEST
(
tests_that_already_connected_blocks_dont_get_reset
);
//
RUN_TEST(test_that_a_self_loop_computation_terminates);
RUN_TEST
(
test_that_a_self_loop_computation_terminates
);
//
RUN_TEST(test_that_nodes_only_update_when_their_inputs_change);
RUN_TEST
(
test_that_nodes_only_update_when_their_inputs_change
);
//
RUN_TEST(test_that_updates_propagate_only_to_their_children);
RUN_TEST
(
test_that_updates_propagate_only_to_their_children
);
//
RUN_TEST(test_that_nodes_get_executed_when_updated_even_if_disconnected);
RUN_TEST
(
test_that_nodes_get_executed_when_updated_even_if_disconnected
);
//
RUN_TEST(test_that_the_get_source_call_works_normally);
RUN_TEST
(
test_that_the_get_source_call_works_normally
);
//
RUN_TEST(test_that_the_get_source_call_returns_ID_neg_1_when_invalid_ID_is_passed);
RUN_TEST
(
test_that_the_get_source_call_returns_ID_neg_1_when_invalid_ID_is_passed
);
//
RUN_TEST(test_that_new_nodes_can_be_created_by_ID);
RUN_TEST
(
test_that_new_nodes_can_be_created_by_ID
);
return
UNITY_END
();
return
UNITY_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