sharifaichallenge / aic19-client-python Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://aichallenge.sharif.edu/
Home Page: https://aichallenge.sharif.edu/
bade run kardane server va etesal client python , ye "preprocess" print mishe badesh error mide .
moshkelesh kojast ?
error :
AttributeError: 'World' object has no attribute '_World__game_constants'
man be source ha dast nazadam sefan hamoonaro test kardam.
client.log
Exception in thread Thread-2:
Traceback (most recent call last):
File "/home/amirftma/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/home/amirftma/anaconda3/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/amirftma/Python/AIC/ourAIchallenge2019/Network.py", line 68, in run
self.message_handler(self.receive())
File "ourAIchallenge2019/Controller.py", line 72, in handle_message
threading.Thread(target=self.launch_on_thread(self.client.pick, new_world)).start()
File "ourAIchallenge2019/Controller.py", line 84, in launch_on_thread
action(new_world)
File "/home/amirftma/Python/AIC/ourAIchallenge2019/AI.py", line 61, in pick
pick_up.select_hero()
File "/home/amirftma/Python/AIC/ourAIchallenge2019/pickup.py", line 15, in select_hero
logging.info("enemy hero %s" % opp)
File "/home/amirftma/Python/AIC/ourAIchallenge2019/Model.py", line 164, in __str__
return 'id:' + str(self.id) + ' name:' + self.name
TypeError: can only concatenate str (not "HeroName") to str
Exception in thread Thread-2:
Traceback (most recent call last):
File "/home/amirftma/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/home/amirftma/anaconda3/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/amirftma/Python/AIC/ourAIchallenge2019/Network.py", line 68, in run
self.message_handler(self.receive())
File "ourAIchallenge2019/Controller.py", line 72, in handle_message
threading.Thread(target=self.launch_on_thread(self.client.pick, new_world)).start()
File "ourAIchallenge2019/Controller.py", line 84, in launch_on_thread
action(new_world)
File "/home/amirftma/Python/AIC/ourAIchallenge2019/AI.py", line 61, in pick
pick_up.select_hero()
File "/home/amirftma/Python/AIC/ourAIchallenge2019/pickup.py", line 15, in select_hero
logging.info("enemy hero %s" % opp)
File "/home/amirftma/Python/AIC/ourAIchallenge2019/Model.py", line 164, in __str__
return 'id:' + str(self.id) + ' name:' + self.name
TypeError: can only concatenate str (not "HeroName") to str
man to move phase sleep(1) mikonam ya for toolani mizanam, server javab mide, mage nabayad time limit bokhore skip beshe ?
سلام
من سعی دارم بررسی کنم که آیا قابلیت هیروی سنتری به حریفی که توی دید یک هیروی دیگه هست اصابت می کنه یا خیر.
تاکید می کنم هیرو در محدوده سنتری نیست و در درد هیروی دیگه ای هست.
در فایل
model > line : 531 > def : get_impact_cells
به دلیل اینکه هیرو در محدوده دید خود سنتری نیست ارایه ای خالی برمی گردونه و این ارایه خالی باعث متوقف شدن برنامه در
model > line : 762 > def : self.get_cells_in_aoe()
می شود.
ارور کاملی که دریافت می کنم :
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/geeksesi/univers/Ai_sharif/patronus/Network.py", line 68, in run
self.message_handler(self.receive())
File "patronus/Controller.py", line 83, in handle_message
[new_world.current_turn])).start()
File "patronus/Controller.py", line 88, in launch_on_thread
action(new_world)
File "/home/geeksesi/univers/Ai_sharif/patronus/AI.py", line 76, in action
self.sentry_action(world, hero)
File "/home/geeksesi/univers/Ai_sharif/patronus/AI.py", line 100, in sentry_action
target_cell=opp_hero.current_cell
File "/home/geeksesi/univers/Ai_sharif/patronus/Model.py", line 762, in get_ability_targets
affected_cells.update(self.get_cells_in_aoe(cell, ability_constant.area_of_effect))
File "/home/geeksesi/univers/Ai_sharif/patronus/Model.py", line 733, in get_cells_in_aoe
for row in range(cell.row - area_of_effect, cell.row + area_of_effect + 1):
AttributeError: 'NoneType' object has no attribute 'row'
این ارور در مواقع دیگه مشاهده نمیشه و کد به درستی کار می کنه.دلیل اینکه بعضی اوقات در یکی از کلاینت ها چنین چیزی مشاهده می کنم رو نمی دونم.
مقادیری که من به تابع ارسال می کنم رو بررسی کردم ولی هیچ اشتباهی ندیدم.
اگر لازم می دونید مقادیر رو در زمان بروز مشکل بفرستم براتون
Salam
tebghe aks dar file AI.py ba khataye import movajeham
chi kar bayad bokonam ?
تو این تابع هیرو های خودی در نظر گرفته نمیشن
و مسیری که پیشنهاد میده ممکنه از هیرو های خودی رد شه
تابع چیزی بر نمی گردونه
hero1=world.get_hero(1)
cella=hero1.current_cell
hero2=world.get_hero(2)
cellb=hero2.current_cell
if cella==cellb:
print("OH!")
l=world.get_path_move_directions((cella.row,cella.column),(cellb.row,cellb.column))
print(l)
این تابع اکسپشن میده وقتی رو همهی خونهها فور میزنم و با یه خونهی ثابت صدا میکنم
world.get_ability_targets(ability=hero.abilities[2],
start_cell=hero.current_cell,
target_cell=end_cell)
{AttributeError}'NoneType' object has no attribute 'is_lobbing'
world.get_ability_targets(ability_name=Model.AbilityName.BLASTER_BOMB,
start_cell=hero.current_cell,
target_cell=end_cell)
{AttributeError}'AbilityName' object has no attribute 'is_lobbing'
Line 71 in f172f2b
OSError: [Errno 22] Invalid argument: 'client- 2019-02-10 17:10:43.034198.log'
windows ":" ro to name e file ejaze nemide.
intori ok mishe:
World.LOG_FILE_POINTER = open('client' + '- ' +
datetime.datetime.now().strftime("%Y-%m-%d %H-%M-%S.%f") + '.log', 'w+')
سلام
من تو گرفتن قهرمانا مشکل دارم، کسی میدونه چطور باید پیک بشن!؟
.
world.pick_hero(Model.HeroName.HEALER)
Model.World.pick_hero(world, hero_name=Model.HeroName.HEALER)
.
در هر صورت my hero خالیه یا چیز نامرتبطی داره
Hi,
in AI module, I write this code: (I pick 4 Sentry heroes in pick phase)
def action(self, world: Model.World):
my_heroes: List[Model.Hero] = world.my_heroes
hero = my_heroes[0]
print(hero.name == HeroName.SENTRY)
>>> False
this peace of code results in false.
according to the AIC Docs, hero.name must be an instance of HeroName Enum, but it is a string.
another example that shows this issue:
print(hero.name)
>>> SENTRY
print(HeroName.SENTRY)
>>> HeroName.SENTRY
مگه تو مرحله ی حرکت هر کاراکتر نمی تونه یه بار جا به جا بشه؟
من که کد می زنم تو هر راند هر هیرو رو فقط یه بار جا به جا می کنه.
Line 205 in 3dfad35
def __str__(self):
string = ''
for row in self.row_num:
for col in self.column_num:
string += str(self.get_cell(row, col))
string += '\n'
self.column , self.row_num int hast o iteratesh error mide
ehtemalan bayad range(self.row_num) va range(self.column_num) bashe
tahesh ye return string ham mikhad
albate felan info ziadi nemide 😄
سلام. وقتتون بخیر.
Traceback (most recent call last): File "Controller.py", line 10, in <module> from queue import Queue ImportError: No module named queue
این ارور رو وقت کامپایل کردن فایل کنترلر دریافت میکنم. مشکل از کجاست؟!
i just use a simple method to move my hero
world.move_hero(hero_id=heroes[0].id , hero=heroes[0] , direction=Model.Direction.DOWN)
i even tried it with two argument constructor , but it doesnt move 👍
world.move_hero(hero_id=heroes[0].id , direction=Model.Direction.DOWN)
in return i get :
None
client jadid be ye khat az kode Model.py gir mide mige syntaxesh eshtebahe :
if hero_id is not None and ability_name is not None and cell is not None:
in khatesho mige
vali syntaxesh doroste
chera injoorie?
Only getAbility() function implemented and other mentioned functions in docs does not implemented.
سلام
من نمیدونم چطور باید کلاینت پایتون رو اجرا کنم. از پای چارم که گزینه ران رو میزنم هیچ اتفاقی نمی افته
all defensive ability types are ok
all dodge ability types are ok
but all offensive ability types are None
for my_hero in world.my_heroes:
for ab in my_hero.abilities:
print(ab.type)
من یه هیرو رو حرکت میدم ولی حرکت نمیکنه , خونه های کناریش هم دیوار نیست . توی هر جهتی هم تست میکنم کار نمیکنه , تازه جهت پایین اررور هم میده
روی هر سه نقشه تست کردم نشد
من از الگوریتم خودتون برای مسیریابی استفاده میکنم.
این الگوریتم یکم مشکل داره چون اینو درنظر نگرفته که هیرو های من هم با دیوار هیچ فرقی ندارن و نمیشه ازشون رد شد و چیزی که برمیگردونه با این فرضه که میشه
چطور میتونیم خروجی بازی رو بدون نمایشگر گرافیکی ببینیم تا یخورده بازی واضح تر بشه برامون؟؟
file controller.py ro run mikonam vali "trying to connect #1" mimone va nemishe dobare run zad bray client 2
(to cmd mizane "client accepted")
الان برای pick کردن هیرو توی پایتون منطقا باید این کار رو کرد:
game = Model.World()
game.pick_hero(Model.HeroName.SENTRY)
ولی این ارور از کلاینت دریافت میشه:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/king0k/Documents/AI_Kill_Me_Python/AIC19-Client-Python-master/Network.py", line 68, in run
self.message_handler(self.receive())
File "Controller.py", line 72, in handle_message
threading.Thread(target=self.launch_on_thread(self.client.pick, new_world)).start()
File "Controller.py", line 84, in launch_on_thread
action(new_world)
File "/home/king0k/Documents/AI_Kill_Me_Python/AIC19-Client-Python-master/AI.py", line 11, in pick
game.pick_hero(Model.HeroName.SENTRY)
File "/home/king0k/Documents/AI_Kill_Me_Python/AIC19-Client-Python-master/Model.py", line 803, in pick_hero
self.queue.put(Event('pick', [hero_name.value]))
AttributeError: 'NoneType' object has no attribute 'put'
مگه نباید توی ورودی تابع pick_hero از enum هایی که ساخته شدن استفاده کرد پس چرا ارور میده؟
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.