DATE=`date '+%Y%m%d_%H%M'`
echo "Save as: " $DATE

# declare -a tasks=('ShadowHand')

# declare -a tasks=( 'ShadowHand' 'ShadowHandCatchAbreast' 'ShadowHandOver' 'ShadowHandBlockStack' 'ShadowHandCatchUnderarm'
# 'ShadowHandCatchOver2Underarm' 'ShadowHandLiftUnderarm' 'ShadowHandBottleCap'
# 'ShadowHandDoorOpenInward'
# )

# mkdir -p log/$DATE

# for i in ${!tasks[@]}; do
# 	nohup python train.py --task=${tasks[$i]} --seed=35 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed28/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
# done
# wait

# declare -a tasks=( 'ShadowHandPen' 'ShadowHandGraspAndPlace' 'ShadowHandSwitch' 'ShadowHandDoorOpenOutward' 'ShadowHandDoorCloseInward'
# 'ShadowHandPushBlock' 'ShadowHandTwoCatchUnderarm'
# 'ShadowHandScissors')

# mkdir -p log/$DATE
# for i in ${!tasks[@]}; do
# 	nohup python train.py --task=${tasks[$i]} --seed=35 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed28/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
# done
# wait

# declare -a tasks=( 'ShadowHand' 'ShadowHandCatchAbreast' 'ShadowHandOver' 'ShadowHandBlockStack' 'ShadowHandCatchUnderarm'
# 'ShadowHandCatchOver2Underarm' 'ShadowHandBottleCap' 'ShadowHandTwoCatchUnderarm'
# 'ShadowHandDoorOpenInward'
# )

# mkdir -p log/$DATE
# for i in ${!tasks[@]}; do
# 	nohup python train.py --task=${tasks[$i]} --seed=36 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed28/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
# done
# wait

# declare -a tasks=( 'ShadowHandPen' 'ShadowHandGraspAndPlace' 'ShadowHandSwitch' 'ShadowHandDoorOpenOutward' 'ShadowHandDoorCloseInward'
# 'ShadowHandPushBlock' 'ShadowHandTwoCatchUnderarm'
# 'ShadowHandScissors')

# mkdir -p log/$DATE
# for i in ${!tasks[@]}; do
# 	nohup python train.py --task=${tasks[$i]} --seed=36 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed28/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
# done
# wait




# declare -a tasks=( 'ShadowHand' 'ShadowHandCatchAbreast' 'ShadowHandOver' 'ShadowHandBlockStack' 'ShadowHandCatchUnderarm'
# 'ShadowHandCatchOver2Underarm' 'ShadowHandBottleCap' 'ShadowHandTwoCatchUnderarm'
# 'ShadowHandDoorOpenInward'
# )

# mkdir -p log/$DATE
# for i in ${!tasks[@]}; do
# 	nohup python train.py --task=${tasks[$i]} --seed=37 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed28/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
# done
# wait

# declare -a tasks=( 'ShadowHandPen' 'ShadowHandGraspAndPlace' 'ShadowHandSwitch' 'ShadowHandDoorOpenOutward' 'ShadowHandDoorCloseInward'
# 'ShadowHandPushBlock' 'ShadowHandTwoCatchUnderarm'
# 'ShadowHandScissors')

# mkdir -p log/$DATE
# for i in ${!tasks[@]}; do
# 	nohup python train.py --task=${tasks[$i]} --seed=37 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed28/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
# done
# wait

# declare -a tasks=( 'ShadowHand' 'ShadowHandCatchAbreast' 'ShadowHandOver' 'ShadowHandBlockStack' 'ShadowHandCatchUnderarm'
# 'ShadowHandCatchOver2Underarm' 'ShadowHandBottleCap' 'ShadowHandTwoCatchUnderarm'
# 'ShadowHandDoorOpenInward'
# )

# mkdir -p log/$DATE
# for i in ${!tasks[@]}; do
# 	nohup python train.py --task=${tasks[$i]} --seed=38 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed29/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
# done
# wait

declare -a tasks=( 'ShadowHandPen' 'ShadowHandGraspAndPlace' 'ShadowHandSwitch' 'ShadowHandDoorOpenOutward' 'ShadowHandDoorCloseInward'
'ShadowHandPushBlock' 'ShadowHandLiftUnderarm'
'ShadowHandScissors')

mkdir -p log/$DATE
for i in ${!tasks[@]}; do
	nohup python train.py --task=${tasks[$i]} --seed=38 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed29/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
done
wait

declare -a tasks=( 'ShadowHand' 'ShadowHandCatchAbreast' 'ShadowHandOver' 'ShadowHandBlockStack' 'ShadowHandCatchUnderarm'
'ShadowHandCatchOver2Underarm' 'ShadowHandBottleCap' 'ShadowHandTwoCatchUnderarm'
'ShadowHandDoorOpenInward'
)

mkdir -p log/$DATE
for i in ${!tasks[@]}; do
	nohup python train.py --task=${tasks[$i]} --seed=39 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed29/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
done
wait

declare -a tasks=( 'ShadowHandPen' 'ShadowHandGraspAndPlace' 'ShadowHandSwitch' 'ShadowHandDoorOpenOutward' 'ShadowHandDoorCloseInward'
'ShadowHandPushBlock' 'ShadowHandLiftUnderarm'
'ShadowHandScissors')

mkdir -p log/$DATE
for i in ${!tasks[@]}; do
	nohup python train.py --task=${tasks[$i]} --seed=39 --rl_device=cuda:$((i % 4)) --sim_device=cuda:$((i % 4)) --graphics_device_id=$((i % 4)) --algo=ppo --headless --num_envs=2048 --max_iterations=5000 --model_dir=/root/autodl-tmp/logs/iteration_2/${tasks[$i]}/ppo_seed29/model_5000.pt --logdir=/root/autodl-tmp/logs/iteration_3/${tasks[$i]}/ppo/ >> log/$DATE/${tasks[$i]}.log &
done
wait