Skip to content

Commit

Permalink
manifest.in added to include json files to the package
Browse files Browse the repository at this point in the history
  • Loading branch information
aadeshnpn committed Jul 4, 2018
1 parent 70477cf commit 29d210f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ def main():
food_objects = grid.get_objects_from_list_of_grid('Food', neighbours)
# print ('TOtal Food prev', len(food_objects))

for i in range(1000000):
for i in range(1000):
env.step()
# best = env.find_higest_performer()
best = env.find_higest_food_collector()
# print ('-----------', i)

if best.food_collected > 0:
print (i, best.name, best.individual[0].fitness, best.food_collected, best.bt.behaviour_tree)
output = py_trees.display.ascii_tree(best.bt.behaviour_tree.root)
print (output)
#if best.food_collected > 0:
print (i, best.name, best.individual[0].fitness, best.food_collected, best.bt.behaviour_tree)
output = py_trees.display.ascii_tree(best.bt.behaviour_tree.root)
print (output)

# for agent in env.agents:
# print (agent.name, agent.attached_objects)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
author_email='aadeshnpn@byu.net',
url='https://github.com/aadeshnpn/swarm',
packages=find_packages(),
include_package_data=True,
install_requires=requires,
keywords='multi-agent',
license='Apache 2.0',
Expand Down
2 changes: 1 addition & 1 deletion swarms/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def step(self):
self.timestamp += 1
self.step_count += 1
# Increase beta
self.beta = self.step_count / 1000000.0
self.beta = self.step_count / 10000.0

self.location_history.add(self.location)
# food_in_hub_before = self.get_food_in_hub()
Expand Down
8 changes: 4 additions & 4 deletions swarms/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
from swarms.utils.jsonhandler import JsonData
from swarms.agent import SwarmAgent
from swarms.objects import Hub, Sites, Food, Derbis, Obstacles
import os

filename = os.path.join(
"/home/aadeshnpn/Documents/BYU/hcmi/swarm/swarms/" + "utils/world.json")
import os, imp

#filename = os.path.join(
# "/home/aadeshnpn/Documents/BYU/hcmi/swarm/swarms/" + "utils/world.json")
filename = os.path.join(imp.find_module("swarms")[1] + "/utils/world.json")

class EnvironmentModel(Model):
"""A environemnt to model swarms."""
Expand Down

0 comments on commit 29d210f

Please sign in to comment.