# Last edited on 2020-12-27 18:44:24 by jstolfi SHELL := /bin/bash RENUM_SCRIPT := make_neuron_renumbering_map.gawk REDUCE_SCRIPT := reduce_nilton.gawk CONVERT_SCRIPT := convert_reduced_nilton_to_nmsim.gawk OUTDEG_SCRIPT := count_outdegrees.gawk PROG := nmsim_elem_net_simulate NILTON_OLD_FILE := data-nilton-old.txt NILTON_NEW_FILE := data-nilton-new.txt NILTON_NEW_SAMPLE_FILE := .head-nilton-new.txt NMSIM_SAMPLE_FILE := .head-nmsim.txt OUTDEG_FILE := outdegrees.txt RENUM_FILE := renumbering.txt NMSIM_FILE := data-nmsim.txt OUT_PREFIX := out/sim OUT_RHO_FILE := ${OUT_PREFIX}_neuron_rho_stats.txt OUT_RHO_PDF := ${OUT_PREFIX}_neuron_rho_stats.pdf OUT_SGRP_FILE := ${OUT_PREFIX}_synapse_stats.txt OUT_SGRP_PDF := ${OUT_PREFIX}_synapse_stats.pdf .PHONY: .PHONY: renumber reduce outdegrees convert sample compile simulate summaries plot-traces all: compile simulate summaries plot-traces NSTEPS := 1000 TMIN := 350 TMAX := 850 INPMIN := -15.0 INPMAX := 25.0 RHOMAX := 0.2000 NNE := 7717 simulate: ${NMSIM_FILE} mkdir -p out rm -f ${OUT_PREFIX}*.{txt,png,ps,pdf} time ${PROG} \ -netFile ${NMSIM_FILE} \ -timeStep 1.0 \ -nSteps ${NSTEPS} \ \ -exInput 0 2068 0 ${NSTEPS} 2.2477 0.6257 \ -exInput 2069 2651 0 ${NSTEPS} 2.1072 0.6059 \ -exInput 2652 4843 0 ${NSTEPS} 2.9501 0.7169 \ -exInput 4844 5391 0 ${NSTEPS} 2.6691 0.6819 \ -exInput 5392 5876 0 ${NSTEPS} 2.8096 0.6996 \ -exInput 5877 5982 0 ${NSTEPS} 2.6691 0.6819 \ -exInput 5983 7422 0 ${NSTEPS} 4.0739 0.8424 \ -exInput 7423 7716 0 ${NSTEPS} 2.9501 0.7169 \ \ -trace 0 0 ${TMIN} ${TMAX} \ -trace 2069 2069 ${TMIN} ${TMAX} \ -trace 2652 2652 ${TMIN} ${TMAX} \ -trace 4844 4844 ${TMIN} ${TMAX} \ -trace 5392 5392 ${TMIN} ${TMAX} \ -trace 5877 5877 ${TMIN} ${TMAX} \ -trace 5983 5983 ${TMIN} ${TMAX} \ -trace 7423 7423 ${TMIN} ${TMAX} \ \ -trace 0 2068 ${TMIN} ${TMAX} \ -trace 2069 2651 ${TMIN} ${TMAX} \ -trace 2652 4843 ${TMIN} ${TMAX} \ -trace 4844 5391 ${TMIN} ${TMAX} \ -trace 5392 5876 ${TMIN} ${TMAX} \ -trace 5877 5982 ${TMIN} ${TMAX} \ -trace 5983 7422 ${TMIN} ${TMAX} \ -trace 7423 7716 ${TMIN} ${TMAX} \ \ -groupStats ${TMIN} ${TMAX} \ -outPrefix ${OUT_PREFIX} summaries: iso-to-ps-hack -8pt -landscape < ${OUT_SGRP_FILE} | ps2pdf - ${OUT_SGRP_PDF} list_stats_by_group.sh ${OUT_PREFIX} > ${OUT_RHO_FILE} iso-to-ps-hack -14pt < ${OUT_RHO_FILE} | ps2pdf - ${OUT_RHO_PDF} LIB_DIR := ${HOME}/programs/c/JSLIBS PROG_DIR := ${HOME}/programs/c/NEUROMAT/${PROG} compile: cd ${LIB_DIR}/libjs && make build-lib install cd ${LIB_DIR}/libnmsim && make build-lib install cd ${LIB_DIR}/libnmsim_e && make build-lib install cd ${PROG_DIR} && make build install plot-traces: plot_traces.sh 1 0 ${NNE} ${OUT_PREFIX} ${TMIN} ${TMAX} ${INPMIN} ${INPMAX} ${RHOMAX} combine_group_plots.sh \ 0000000000--0000002068 \ 0000002069--0000002651 \ 0000002652--0000004843 \ 0000004844--0000005391 \ 0000005392--0000005876 \ 0000005877--0000005982 \ 0000005983--0000007422 \ 0000007423--0000007716 renumber: ${RENUM_FILE} reduce: ${NILTON_NEW_FILE} outdegrees: ${OUTDEG_FILE} convert: ${NMSIM_FILE} sample: ${NMSIM_SAMPLE_FILE} ${RENUM_FILE}: ${RENUM_SCRIPT} ${RENUM_SCRIPT} \ > ${RENUM_FILE} ${NILTON_NEW_FILE}: ${NILTON_OLD_FILE} ${REDUCE_SCRIPT} rm -f ${NILTON_NEW_SAMPLE_FILE} ${REDUCE_SCRIPT} \ -v renfname=${RENUM_FILE} \ < ${NILTON_OLD_FILE} \ > ${NILTON_NEW_FILE} head -n 1000 ${NILTON_NEW_FILE} > ${NILTON_NEW_SAMPLE_FILE} ${OUTDEG_FILE}: ${NILTON_NEW_FILE} ${OUTDEG_SCRIPT} ${OUTDEG_SCRIPT} \ -v nne=7717 \ < ${NILTON_NEW_FILE} \ > ${OUTDEG_FILE} ${NMSIM_FILE}: ${NILTON_NEW_FILE} ${OUTDEG_FILE} ${CONVERT_SCRIPT} rm -f ${NMSIM_SAMPLE_FILE} ${CONVERT_SCRIPT} \ -v dead=0 \ -v odfname="${OUTDEG_FILE}" \ < ${NILTON_NEW_FILE} \ > ${NMSIM_FILE} ${NMSIM_SAMPLE_FILE}: ${NMSIM_FILE} head -n 1000 ${NMSIM_FILE} > ${NMSIM_SAMPLE_FILE} echo "..." >> ${NMSIM_SAMPLE_FILE} egrep \ -A 30 -B 10 \ -e '^ *0 +0 +([0-9] *$$|.*[.][0-9])' \ ${NMSIM_FILE} \ >> ${NMSIM_SAMPLE_FILE} echo "..." >> ${NMSIM_SAMPLE_FILE} tail -n 100 ${NMSIM_FILE} >> ${NMSIM_SAMPLE_FILE}