Skip to content

Commit

Permalink
Updated reward function
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperg3 committed Aug 20, 2024
1 parent 7fdad3d commit 4456322
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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.7"
version = "0.0.8"
description = "TrajAllocPy is a Python library that provides functionality for trajectory task Allocaition using Consensus based bundle algorithm"
readme = "README.md"
authors = [
Expand Down
5 changes: 3 additions & 2 deletions trajallocpy/Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ def getTravelCost(start, end, environment):


def getTimeDiscountedReward(cost, Lambda, task: TrajectoryTask):
# return np.exp((Lambda - 1) * cost) * task.reward
return Lambda ** (cost) * task.reward
# return np.exp((Lambda - 1) * cost) * task.reward +1
# return Lambda ** (cost) + task.reward
return max(0, -math.log(cost) + 1000) * task.reward


def getMinTravelCost(point, task: TrajectoryTask, environment):
Expand Down

0 comments on commit 4456322

Please # to comment.