#!/usr/bin/env bash
# Cola 4: capacidad del colector (cauce tallado + sumidero en la embocadura), robustez con terreno SPOT y luego 300 mil m³.
#  f01 (ya corrida) = cauce tallado sin colector = capacidad 0.
cd "$(dirname "$0")"; export OMP_NUM_THREADS=5
lanzar(){ n=$1; shift; while [ $(ps -eo args | grep "[s]im.py --origen" | grep -v "bash -c" | grep -vc "res/humo") -ge 3 ]; do sleep 30; done
  ( .venv/bin/python sim.py "$@" --fino 40 --salida res/$n > res/$n.log 2>&1; echo "terminó $n" >> res/barrido.log ) & sleep 20; }
lanzar s01 --origen H1 --terreno terreno_spot.npz --vol 150000 --qp 250 --suelo glenwood2b --cv 0.40 --cfl 1.0
lanzar k03 --origen H1 --terreno terreno_tallado.npz --colector 10 --vol 150000 --qp 250 --suelo glenwood2b --cv 0.40 --cfl 1.0
lanzar f03 --origen H4 --fsup 0.5 --fs2 0.05 --lluvia 35 --vol 150000 --qp 250 --suelo glenwood2b --cv 0.40 --cfl 0.5
lanzar e04 --origen H1 --terreno terreno_tallado.npz --vol 300000 --qp 250 --suelo glenwood2b --cv 0.40 --cfl 1.0
lanzar e06 --origen H1 --terreno terreno_tallado.npz --vol 150000 --qp 250 --suelo glenwood1 --cv 0.45 --cfl 1.0
wait
