#! /bin/bash Method="COC81" Style="precise" MyRoot="../../../trunk/" Path="/var/experiment_dBFS" DataPath=$Path"/data" rm -r $Path mkdir -p $DataPath # output the first line of the csv output describing the field names echo "#FILENAME,I,LEARNER,ESTIMATE,ACTUAL,MRE,COST_DRIVERS" # Preprocess the full coc81 and nasa93 datasets cp $MyRoot"data/coc81modetypelangtype.csv" $DataPath"/coc81_all.csv" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/coc81_all.csv" > $DataPath"/coc81_all.csv.numeric" cp $MyRoot"data/nasa93.csv" $DataPath"/nasa93_all.csv" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_all.csv" > $DataPath"/nasa93_all.csv.numeric" #Make the subsets of coc81 data gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="kind" Want="min" $MyRoot"data/coc81modetypelangtype.csv" > $DataPath"/coc81_kind_min.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="lang" Want="ftn" $MyRoot"data/coc81modetypelangtype.csv" > $DataPath"/coc81_lang_ftn.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="mode" Want="e" $MyRoot"data/coc81modetypelangtype.csv" > $DataPath"/coc81_mode_e.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="kind" Want="max" $MyRoot"data/coc81modetypelangtype.csv" > $DataPath"/coc81_kind_max.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="mode" Want="org" $MyRoot"data/coc81modetypelangtype.csv" > $DataPath"/coc81_mode_org.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="lang" Want="mol" $MyRoot"data/coc81modetypelangtype.csv" > $DataPath"/coc81_lang_mol.csv" #Convert the subsets of coc81 data to numbers gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/coc81_kind_min.csv" > $DataPath"/coc81_kind_min.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/coc81_lang_ftn.csv" > $DataPath"/coc81_lang_ftn.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/coc81_mode_e.csv" > $DataPath"/coc81_mode_e.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/coc81_kind_max.csv" > $DataPath"/coc81_kind_max.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/coc81_mode_org.csv" > $DataPath"/coc81_mode_org.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/coc81_lang_mol.csv" > $DataPath"/coc81_lang_mol.csv.numeric" #Make the subsets of nasa93 data gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="projectname" Want="gro" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_project_gro.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="cat2" Want="missionplanning" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_cat2_missionplanning.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="cat2" Want="avionicsmonitoring" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_cat2_avionicsmonitoring.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="mode" Want="semidetached" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_mode_semidetached.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="projectname" Want="sts" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_project_sts.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="forg" Want="g" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_forg_g.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="center" Want="5" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_center_5.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="year" Want="1975" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_year_1975.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="year" Want="1980" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_year_1980.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="mode" Want="embedded" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_mode_embedded.csv" gawk -f $MyRoot"baker_lc/csvsubset.awk" Col="center" Want="2" $MyRoot"data/nasa93.csv" > $DataPath"/nasa93_center_2.csv" #Convert the subsets of nasa93 data to numbers gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_project_gro.csv" > $DataPath"/nasa93_project_gro.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_cat2_missionplanning.csv" > $DataPath"/nasa93_cat2_missionplanning.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_cat2_avionicsmonitoring.csv" > $DataPath"/nasa93_cat2_avionicsmonitoring.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_mode_semidetached.csv" > $DataPath"/nasa93_mode_semidetached.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_project_sts.csv" > $DataPath"/nasa93_project_sts.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_forg_g.csv" > $DataPath"/nasa93_forg_g.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_center_5.csv" > $DataPath"/nasa93_center_5.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_year_1975.csv" > $DataPath"/nasa93_year_1975.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_year_1980.csv" > $DataPath"/nasa93_year_1980.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_mode_embedded.csv" > $DataPath"/nasa93_mode_embedded.csv.numeric" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method=$Method Style=$Style $DataPath"/nasa93_center_2.csv" > $DataPath"/nasa93_center_2.csv.numeric" # make a function to get the filename without path or extension function get_name() { local base=${1##*/} local base0="${base%.*}" local base1="${base0%.*}" echo $base1 } # try on full datasets experiment_dBFS $DataPath"/coc81_all.csv.numeric" $(get_name $DataPath"/coc81_all.csv.numeric") experiment_dBFS $DataPath"/nasa93_all.csv.numeric" $(get_name $DataPath"/nasa93_all.csv.numeric") # run on coc81 data subsets experiment_dBFS $DataPath"/coc81_kind_min.csv.numeric" $(get_name $DataPath"/coc81_kind_min.csv.numeric") experiment_dBFS $DataPath"/coc81_lang_ftn.csv.numeric" $(get_name $DataPath"/coc81_lang_ftn.csv.numeric") experiment_dBFS $DataPath"/coc81_mode_e.csv.numeric" $(get_name $DataPath"/coc81_mode_e.csv.numeric") experiment_dBFS $DataPath"/coc81_kind_max.csv.numeric" $(get_name $DataPath"/coc81_kind_max.csv.numeric") experiment_dBFS $DataPath"/coc81_mode_org.csv.numeric" $(get_name $DataPath"/coc81_mode_org.csv.numeric") experiment_dBFS $DataPath"/coc81_lang_mol.csv.numeric" $(get_name $DataPath"/coc81_lang_mol.csv.numeric") # run on nasa93 data subsets experiment_dBFS $DataPath"/nasa93_project_gro.csv.numeric" $(get_name $DataPath"/nasa93_project_gro.csv.numeric") experiment_dBFS $DataPath"/nasa93_cat2_missionplanning.csv.numeric" $(get_name $DataPath"/nasa93_cat2_missionplanning.csv.numeric") experiment_dBFS $DataPath"/nasa93_cat2_avionicsmonitoring.csv.numeric" $(get_name $DataPath"/nasa93_cat2_avionicsmonitoring.csv.numeric") experiment_dBFS $DataPath"/nasa93_mode_semidetached.csv.numeric" $(get_name $DataPath"/nasa93_mode_semidetached.csv.numeric") experiment_dBFS $DataPath"/nasa93_project_sts.csv.numeric" $(get_name $DataPath"/nasa93_project_sts.csv.numeric") experiment_dBFS $DataPath"/nasa93_forg_g.csv.numeric" $(get_name $DataPath"/nasa93_forg_g.csv.numeric") experiment_dBFS $DataPath"/nasa93_center_5.csv.numeric" $(get_name $DataPath"/nasa93_center_5.csv.numeric") experiment_dBFS $DataPath"/nasa93_year_1975.csv.numeric" $(get_name $DataPath"/nasa93_year_1975.csv.numeric") experiment_dBFS $DataPath"/nasa93_year_1980.csv.numeric" $(get_name $DataPath"/nasa93_year_1980.csv.numeric") experiment_dBFS $DataPath"/nasa93_mode_embedded.csv.numeric" $(get_name $DataPath"/nasa93_mode_embedded.csv.numeric") experiment_dBFS $DataPath"/nasa93_center_2.csv.numeric" $(get_name $DataPath"/nasa93_center_2.csv.numeric")