Git Product home page Git Product logo

carbon_challenge's People

Contributors

524633094 avatar moliqingwa avatar xwzcwq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

carbon_challenge's Issues

Some problems

1.The file of https://github.com/moliqingwa/carbon_challenge/blob/master/zerosum_env/envs/__init__.py can be deleted, or it will be regarded as a env named __init__.py , and there are some warnings like Loading environment __init__.py failed: No module named 'zerosum_env.envs.__init__.py'; 'zerosum_env.envs.__init__' is not a package when runing the import zerosum_env

2.The file of https://github.com/moliqingwa/carbon_challenge/blob/master/zerosum_env/envs/carbon/test_carbon.py can be deleted because it is modified from the test_halite.py, some unittest maybe wrong and also some code have not been modify like

recrtCenter.next_action = RecrtCenterAction.SPAWN

opponent_worker.next_action = WorkerAction.CONVERT

worker.next_action = WorkerAction.CONVERT

and others. The action SPAWN or CONVERT does not belong to the carbon env.

3.The render of the html seems to only support the 2 agents, when the agents is 1 or 4, the visualization of the html open by the Browser are show below:
image
So if we don't want to support the visualization of the 4 agents or 1 agents, maybe we can modify the readme file blow:

# 确定地图选手数(只能是1,2,4)

And provide the example the train_selfplay with 2 agents in the readme file.
trainer = env.train_selfplay([None, None, 'random', 'random'])

Also
if num_agents == 1:
starting_positions[0] = size * (size // 2) + size // 2
elif num_agents == 2:
# starting_positions[0] = size * (size // 2) + size // 4
# starting_positions[1] = size * (size // 2) + math.ceil(3 * size / 4) - 1
starting_positions[0] = size * (size // 4 + config.startPosOffset) + size // 4 + config.startPosOffset
starting_positions[1] = size * (3 * size // 4 - config.startPosOffset) + 3 * size // 4 - config.startPosOffset
obs.carbon[starting_positions[0]] = 0
obs.carbon[starting_positions[1]] = 0
elif num_agents == 4:
starting_positions[0] = size * (size // 4) + size // 4
starting_positions[1] = size * (size // 4) + 3 * size // 4
starting_positions[2] = size * (3 * size // 4) + size // 4
starting_positions[3] = size * (3 * size // 4) + 3 * size // 4

and https://github.com/moliqingwa/carbon_challenge/blob/2e65f7ec89c7f7c9af81056afe495665c18141cd/zerosum_env/envs/carbon/carbon.json#L6-L0
can be reduced to only support 2.

4.readme中捕碳员或种树员上限为10, collector 和 plantor 总和10 还是各自10?代码是总和10, 确认下。

for recrtCenter in player.recrtCenters:
# 招募捕碳员指令
if recrtCenter.next_action == RecrtCenterAction.RECCOLLECTOR and player.cash >= rec_collector_cost and len(
player.workers) < configuration.worker_limit: # and len(player.collectors) < configuration.collector_limit # 暂时不控制捕碳员的数量
# Handle RECCOLLECTOR actions
player._cash = round(player._cash - rec_collector_cost, 2)
board._add_worker(
Collector(WorkerId(new_worker_id(player.id)), recrtCenter.position, 0, player.id, board))
# 招募种树员指令
if recrtCenter.next_action == RecrtCenterAction.RECPLANTOR and player.cash >= rec_plantor_cost and len(
player.workers) < configuration.worker_limit: # and len(player.plantors) < configuration.plantor_limit # 暂时不控制种树员的数量
# Handle RECPLANTOR actions
player._cash = round(player._cash - rec_plantor_cost, 2)
board._add_worker(
Plantor(WorkerId(new_worker_id(player.id)), recrtCenter.position, 0, player.id, board))
# Clear the recrtCenter's action so it doesn't repeat the same action automatically
recrtCenter.next_action = None

  1. readme 中的个别注释还存在飞船字段还没有修改。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.