Skip to content

Commit

Permalink
Merge pull request #14 from JoOkuma/motile-plural-fix
Browse files Browse the repository at this point in the history
Update motile API calls
  • Loading branch information
bentaculum authored Sep 2, 2024
2 parents cb4e79a + 82a9c41 commit 5cc087d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ include_package_data = True

[options.extras_require]
ilp =
motile >= 0.2
motile >= 0.3
dev =
pytest
ruff
Expand Down
14 changes: 7 additions & 7 deletions trackastra/tracking/ilp.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,35 +109,35 @@ def solve_full_ilp(
used_costs = SimpleNamespace()

# NODES
solver.add_costs(
solver.add_cost(
motile.costs.NodeSelection(weight=p.nodeW, constant=p.nodeC, attribute="weight")
)
used_costs.nodeW = p.nodeW
used_costs.nodeC = p.nodeC

# EDGES
solver.add_costs(
solver.add_cost(
motile.costs.EdgeSelection(weight=p.edgeW, constant=p.edgeC, attribute="weight")
)
used_costs.edgeW = p.edgeW
used_costs.edgeC = p.edgeC

# APPEAR
solver.add_costs(motile.costs.Appear(constant=p.appearC))
solver.add_cost(motile.costs.Appear(constant=p.appearC))
used_costs.appearC = p.appearC

# DISAPPEAR
solver.add_costs(motile.costs.Disappear(constant=p.disappearC))
solver.add_cost(motile.costs.Disappear(constant=p.disappearC))
used_costs.disappearC = p.disappearC

# DIVISION
if allow_divisions:
solver.add_costs(motile.costs.Split(constant=p.splitC))
solver.add_cost(motile.costs.Split(constant=p.splitC))
used_costs.splitC = p.splitC

# Add constraints
solver.add_constraints(motile.constraints.MaxParents(1))
solver.add_constraints(motile.constraints.MaxChildren(2 if allow_divisions else 1))
solver.add_constraint(motile.constraints.MaxParents(1))
solver.add_constraint(motile.constraints.MaxChildren(2 if allow_divisions else 1))

solver.solve()

Expand Down

0 comments on commit 5cc087d

Please sign in to comment.