Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Detection eddies
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
IPSL
LMD
DPAO
Detection eddies
Commits
76741d40
Commit
76741d40
authored
2 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Rename src to source and trg to target
parent
fbb1116b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
trajectories.py
+15
-14
15 additions, 14 deletions
trajectories.py
with
15 additions
and
14 deletions
trajectories.py
+
15
−
14
View file @
76741d40
...
...
@@ -42,27 +42,28 @@ print('Setting trajectory vertex property...')
for
edge
in
g
.
edges
():
current_cf
=
g
.
ep
.
cost_function
[
edge
]
src
=
edge
.
source
()
trg
=
edge
.
target
()
s
ou
rc
e
=
edge
.
source
()
t
a
rg
et
=
edge
.
target
()
if
src
.
out_degree
()
>
1
:
if
s
ou
rc
e
.
out_degree
()
>
1
:
# Source is a split
if
current_cf
<=
min
({
g
.
ep
.
cost_function
[
e
]
for
e
in
src
.
out_edges
()}):
if
trg
.
in_degree
()
>
1
:
if
current_cf
<=
min
({
g
.
ep
.
cost_function
[
e
]
for
e
in
source
.
out_edges
()}):
if
target
.
in_degree
()
>
1
:
if
current_cf
<=
min
({
g
.
ep
.
cost_function
[
e
]
for
e
in
trg
.
out_edges
()}):
# Set trg trajectory to src trajectory
traj_prop
[
trg
]
=
traj_prop
[
src
]
for
e
in
t
a
rg
et
.
out_edges
()}):
# Set t
a
rg
et
trajectory to s
ou
rc
e
trajectory
traj_prop
[
t
a
rg
et
]
=
traj_prop
[
s
ou
rc
e
]
else
:
traj_prop
[
trg
]
=
traj_prop
[
src
]
traj_prop
[
t
a
rg
et
]
=
traj_prop
[
s
ou
rc
e
]
else
:
# src.out_degree() == 1
if
trg
.
in_degree
()
>
1
:
# s
ou
rc
e
.out_degree() == 1
if
t
a
rg
et
.
in_degree
()
>
1
:
if
current_cf
<=
min
({
g
.
ep
.
cost_function
[
e
]
for
e
in
trg
.
in_edges
()}):
traj_prop
[
trg
]
=
traj_prop
[
src
]
for
e
in
t
a
rg
et
.
in_edges
()}):
traj_prop
[
t
a
rg
et
]
=
traj_prop
[
s
ou
rc
e
]
else
:
traj_prop
[
trg
]
=
traj_prop
[
src
]
traj_prop
[
t
a
rg
et
]
=
traj_prop
[
s
ou
rc
e
]
print
(
'
Creating the dictionary of trajectories...
'
)
visitor
=
Visitor
()
...
...
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