#!/bin/bash

###################################
## Simulation of a diffusion process
## (define MODEL_DIF in defs.h)
###################################

## remove all previously generated files
./clean -f
#./clean

if [ ! -e genesis ]; then
  ln -s src/genesis .
fi
if [ ! -e rescal ]; then
  ln -s src/rescal .
fi

## parameters file (input)
PAR_FILE="diffusion.par"

## general log files (output)
GENESIS_LOG_FILE="GENESIS.log"
RESCAL_LOG_FILE="RESCAL.log"

## generation of binary cellular space 
./genesis -f $PAR_FILE -g 2000 > $GENESIS_LOG_FILE

## generation of png images, data files and info logs, then stop after 30 minutes
nice ./rescal $PAR_FILE -info -dpng 10 -dcsp 1 -stop 30 >> $RESCAL_LOG_FILE


