diff --git a/application/eda_sa/CMakeLists.txt b/application/eda_sa/CMakeLists.txt index 8cdc8c13..e8ec6f13 100644 --- a/application/eda_sa/CMakeLists.txt +++ b/application/eda_sa/CMakeLists.txt @@ -25,4 +25,4 @@ FILE(GLOB SOURCES *.cpp) SET(EXECUTABLE_OUTPUT_PATH ${DO_BINARY_DIR}) ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES}) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} do ${EO_LIBRARIES} ${MO_LIBRARIES} ${Boost_LIBRARIES}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} do doutils ${EO_LIBRARIES} ${MO_LIBRARIES} ${Boost_LIBRARIES}) diff --git a/application/eda_sa/plot_on_ggobi.py b/application/eda_sa/plot_on_ggobi.py new file mode 100755 index 00000000..2e934183 --- /dev/null +++ b/application/eda_sa/plot_on_ggobi.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python + +from pprint import * +import sys, os + +if __name__ == '__main__': + + # parameter phase + + if len(sys.argv) < 2: + print 'Usage: %s [FILE]' % sys.argv[0] + sys.exit() + + filename = sys.argv[1] + + lines = open(filename).readlines() + + # formatting phase + + try: + results = [ x.split() for x in lines[1:-1] ] + except IOError, e: + print 'Error: %s' % e + sys.exit() + + # dimension estimating phase + + popsize = int(lines[0].split()[0]) + dimsize = int(results[0][1]) + + # printing phase + + print 'popsize: %d' % popsize + print 'dimsize: %d' % dimsize + + print + pprint( results ) + + # cvs converting phase + + i = 1 + for x in results: + x.insert(0, '"%d"' % i) + i += 1 + + header = ['""', '"fitness"', '"dimsize"'] + + for i in range(0, dimsize): + header.append( '"dim%d"' % i ) + + results.insert(0, header) + + # cvs printing phase + + file_results = '\n'.join( [ ','.join( x ) for x in results ] ) + + print + print file_results + + try: + open('%s.csv' % filename, 'w').write(file_results + '\n') + except IOError, e: + print 'Error: %s' % e + sys.exit() + + # ggobi plotting phase + + os.system('ggobi %s.csv' % filename) diff --git a/do.pc b/do.pc index 44155200..b207747d 100644 --- a/do.pc +++ b/do.pc @@ -8,5 +8,5 @@ includedir=${prefix}/include/do Name: Distribution Object Description: Distribution Object Version: 1.0 -Libs: -L${libdir} -ldo +Libs: -L${libdir} -ldo -ldoutils Cflags: -I${includedir} diff --git a/src/utils/doFileSnapshot.cpp b/src/utils/doFileSnapshot.cpp index 6879d75e..3ad012f7 100644 --- a/src/utils/doFileSnapshot.cpp +++ b/src/utils/doFileSnapshot.cpp @@ -62,7 +62,7 @@ doFileSnapshot::doFileSnapshot(std::string dirname, } else if (!res && rmFiles) { - s = std::string("/bin/rm ") + _dirname+ "/" + _filename + "*"; + s = std::string("/bin/rm -f ") + _dirname+ "/" + _filename + "*"; } else {