Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/ocean/cpr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rnn_name = Recurrent
[env]
num_envs = 512
vision = 3
num_agents = [12]
num_agents = [8]
report_interval=1
reward_food = 0.1
interactive_food_reward = 0.2
Expand All @@ -19,7 +19,7 @@ num_envs = 1
num_workers = 1
total_timesteps = 60_000_000
device = cpu
batch_size = 32768
batch_size = 65536
minibatch_size = 8192
bptt_horizon = 16
checkpoint_interval = 200
Expand Down Expand Up @@ -64,4 +64,4 @@ distribution = log_normal
min = 50e6
max = 75e6
mean = 60e6
scale = time
scale = time
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int main() {
int render_cell_size = 32;

CCpr env = {
.num_agents = 1,
.num_agents = 8,
.width = width,
.height = height,
.vision = 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ void step_agent(CCpr *env, int i) {
Agent *agent = &env->agents[i];

int action = env->actions[i];
env->logs[i].episode_length += 1;
env->log->episode_length += 1;

int dr = 0;
int dc = 0;
Expand Down Expand Up @@ -690,7 +690,7 @@ Renderer *init_renderer(int cell_size, int width, int height) {
InitWindow(width * cell_size, height * cell_size, "CPR");
SetTargetFPS(10);

renderer->puffer = LoadTexture("resources/cpr/puffers_128.png");
renderer->puffer = LoadTexture("resources/common_pool_resource/puffers_128.png");
return renderer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np

import pufferlib
from pufferlib.ocean.cpr.cy_cpr import CyEnv
from pufferlib.ocean.common_pool_resource.cy_cpr import CyEnv

class PyCPR(pufferlib.PufferEnv):
def __init__(self,
Expand Down Expand Up @@ -85,12 +85,12 @@ def close(self):

import time
start = time.time()
# while time.time() - start < timeout:
while tick < 500:
while time.time() - start < timeout:
# while tick < 500:
atns = actions[tick % 1024]
env.step(atns)
if -1 in env.rewards:
breakpoint()
# if -1 in env.rewards:
# breakpoint()
# env.render()
tick += 1

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pufferlib/ocean/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def make_multiagent(buf=None, **kwargs):
'trash_pickup': lambda: lazy_import('pufferlib.ocean.trash_pickup.trash_pickup', 'TrashPickupEnv'),
'tower_climb': lambda: lazy_import('pufferlib.ocean.tower_climb.tower_climb', 'TowerClimb'),
'grid': lambda: lazy_import('pufferlib.ocean.grid.grid', 'Grid'),
'cpr': lambda: lazy_import('pufferlib.ocean.cpr.cpr', 'PyCPR'),
'cpr': lambda: lazy_import('pufferlib.ocean.common_pool_resource.cpr', 'PyCPR'),
'impulse_wars': lambda: lazy_import('pufferlib.ocean.impulse_wars.impulse_wars', 'ImpulseWars'),
'gpudrive': lambda: lazy_import('pufferlib.ocean.gpudrive.gpudrive', 'GPUDrive'),
#'rocket_lander': rocket_lander.RocketLander,
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@
# 'pufferlib/ocean/go/cy_go',
'pufferlib/ocean/rware/cy_rware',
'pufferlib/ocean/trash_pickup/cy_trash_pickup',
'pufferlib/ocean/cpr/cy_cpr',
'pufferlib/ocean/common_pool_resource/cy_cpr',
# 'pufferlib/ocean/tower_climb/cy_tower_climb',
'pufferlib/ocean/tower_climb/cy_tower_climb',
'pufferlib/ocean/gpudrive/cy_gpudrive',
]
Expand Down
Loading