Skip to content

Commit

Permalink
bumped version and fixed floatingpoint error
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperg3 committed Aug 15, 2024
1 parent b7bba43 commit 7fdad3d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "trajallocpy"
version = "0.0.6"
version = "0.0.7"
description = "TrajAllocPy is a Python library that provides functionality for trajectory task Allocaition using Consensus based bundle algorithm"
readme = "README.md"
authors = [
Expand Down
4 changes: 2 additions & 2 deletions trajallocpy/Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BidInformation:
# sender_id: int


def distanceToCost(dist, max_velocity=3, max_acceleration=1):
def distanceToCost(dist, max_velocity=5, max_acceleration=2):
d_a = (max_velocity**2) / max_acceleration
result = math.sqrt(4 * dist / max_acceleration) if dist < d_a else max_velocity / max_acceleration + dist / max_velocity
return result
Expand Down Expand Up @@ -116,7 +116,7 @@ def test_calculatePathRewardWithNewTask(environment, agent, taskCurr, taskPrev,
return score, minStart, maxStart


def calculatePathRewardWithNewTask(j, n, state, tasks, path, environment, use_single_point_estimation=False, Lambda=0.95):
def calculatePathRewardWithNewTask(j, n, state, tasks, path, environment, Lambda, use_single_point_estimation=False):
temp_path = list(path)
temp_path.insert(n, j)
# print(j)
Expand Down
6 changes: 3 additions & 3 deletions trajallocpy/CBBA.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from trajallocpy import Agent
from trajallocpy.Task import TrajectoryTask

EPSILON = 1e-10
EPSILON = np.finfo(float).eps


class BundleResult:
Expand Down Expand Up @@ -80,7 +80,7 @@ def __init__(
else:
self.state = state.coords[0]
# socre function parameters
self.Lambda = 0.95
self.Lambda = 0.99

self.availability_time = 0

Expand Down Expand Up @@ -123,7 +123,7 @@ def getCij(self):

for n, j in itertools.product(range(len(self.path) + 1), tasks_to_check):
S_pj, should_be_reversed, best_time = Agent.calculatePathRewardWithNewTask(
j, n, self.state, self.tasks, self.path, self.environment, self.use_single_point_estimation
j, n, self.state, self.tasks, self.path, self.environment, self.Lambda, self.use_single_point_estimation
)
c_ijn = S_pj - S_p
if c[j] < c_ijn:
Expand Down
4 changes: 2 additions & 2 deletions trajallocpy/Experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ def solve(self, profiling_enabled=False, debug=False):

self.end_time = timeit.default_timer()

print("Robot Routes")
# print("Robot Routes")
routes = {}
for robot in self.robot_list.values():
routes[robot.id] = robot.getPathTasks()

print(routes)
# print(routes)
if self.plot:
plotter.plotAgents(self.robot_list.values())
if self.plot:
Expand Down

0 comments on commit 7fdad3d

Please # to comment.