Open elsid opened 5 years ago
Fixed conversion to opposite coordinates. x
should be same.
How to check.
impl Strategy for MyStrategyImpl {
fn act(&mut self, me: &Robot, rules: &Rules, game: &Game, action: &mut Action) {
println!("{} {:?}", me.id, game.robots.iter().map(|v| (v.id, v.x)).collect::<Vec<_>>());
action.target_velocity_x = 30.0;
}
}
local_runner/codeball2018 \
--noshow \
--team-size 1 \
--log-file ${PWD}/game.json \
--p1-name a \
--p2-name b \
--p1 tcp-31001 \
--p2 tcp-31002 &
sleep 1
target/release/my-strategy 127.0.0.1 31001 0000000000000000 > a1.log &
sleep 1
target/release/my-strategy 127.0.0.1 31002 0000000000000000 > b1.log
wait
local_runner/codeball2018 \
--noshow \
--team-size 1 \
--p1-name a \
--p2-name b \
--p1 tcp-31001 \
--p2 tcp-31002 &
sleep 1
target/release/repeater a 127.0.0.1 31001 0000000000000000 < ${PWD}/game.json > a2.log &
sleep 1
target/release/repeater b 127.0.0.1 31002 0000000000000000 < ${PWD}/game.json > b2.log
wait
diff a1.log a2.log
diff b1.log b2.log
It differs without 424b1d16bcdc650a287a664000746b363a2efdc1.
Introduced as replacement for Repeater (https://russianaicup.ru/p/repeater) to use for Rust-only strategies (same approach could be use for any other language). The idea is to read stdin with game log and communicate with local runner in the same time. Local runner data is ignored. Instead stdin is used to read and parse game state. Strategy output action is ignored. Default action is sent to local runner. So local runner will not show any activity, but one could use custom rendering to visualize in schematic view any data.
Usage example: