diff --git a/eo/app/gprop/mlp.h b/eo/app/gprop/mlp.h index 3628325f1..dbd12bda2 100644 --- a/eo/app/gprop/mlp.h +++ b/eo/app/gprop/mlp.h @@ -20,6 +20,10 @@ #include #include +#ifdef HAVE_LIBYAML_CPP +#include +#endif // HAVE_LIBYAML_CPP + namespace mlp { @@ -125,6 +129,21 @@ namespace mlp if ( probability >= 1.0 || rng.uniform() < probability) perturb_num(bias, magnitude); } + + #ifdef HAVE_LIBYAML_CPP + YAML_SERIALIZABLE_AUTO(neuron) + void emit_yaml(YAML::Emitter&out) const { + out << YAML::BeginMap; + out << YAML::Key << "Class" << YAML::Value << "mlp::neuron"; + YAML_EMIT_MEMBER(out,bias); + YAML_EMIT_MEMBER(out,weight); + out << YAML::EndMap; + } + void load_yaml(const YAML::Node& node) { + YAML_LOAD_MEMBER(node, bias); + YAML_LOAD_MEMBER(node, weight); + } + #endif }; } @@ -140,8 +159,10 @@ namespace std { return is >> n.bias >> n.weight; } + } + namespace mlp { //--------------------------------------------------------------------------- @@ -190,6 +211,21 @@ namespace mlp { for(iterator n = begin(); n != end(); ++n) n->perturb(); } + #ifdef HAVE_LIBYAML_CPP + friend ostream& operator<<(YAML::Emitter& e, const layer &l) { + e << ((std::vector)l); + } + + friend void operator>>(const YAML::Node& n, layer &l) { + // These temporary variable shenanegins are necessary because + // the compiler gets very confused about which template operator>> + // function to use. + // The following does not work: n >> l; + // So we use a temporary variable thusly: + std::vector *obviously_a_vector = &l; + n >> *obviously_a_vector; + } + #endif }; @@ -222,6 +258,9 @@ namespace mlp { //--------------------------------------------------------------------------- class net: public std::vector + #ifdef HAVE_LIBYAML_CPP + , public YAML::Serializable + #endif { public: net(const unsigned& num_inputs = 0, @@ -235,6 +274,18 @@ namespace mlp { net(istream &is) { load(is); } + #ifdef HAVE_LIBYAML_CPP + YAML_SERIALIZABLE_AUTO(net) + void emit_members(YAML::Emitter&out) const { + const std::vector* me_as_layer_vector = this; + out << YAML::Key << "layers" << YAML::Value << *me_as_layer_vector; + } + + void load_members(const YAML::Node& node) { + std::vector* me_as_layer_vector = this; + node["layers"] >> *me_as_layer_vector; + } + #endif // HAVE_LIBYAML_CPP /** Virtual destructor */ virtual ~net() {}; @@ -305,10 +356,13 @@ namespace mlp { for(const_iterator l = begin(); l != end(); ++l) os << l->size() << " "; os << "\n"; - os << *this; - os << "\n"; + os << "< "; + for(const_iterator l = begin(); l != end(); ++l) + os << *l << " "; + os << ">\n"; } + unsigned num_inputs() const { return front().front().length() - 1; } unsigned num_outputs() const { return back().size(); } unsigned num_hidden_layers() const { diff --git a/eo/configure.in b/eo/configure.in index 6aaa54484..50c257941 100644 --- a/eo/configure.in +++ b/eo/configure.in @@ -38,6 +38,22 @@ AC_TYPE_SIZE_T dnl Checks for libraries and library functions. AC_CHECK_LIB(m, cos) + +dnl Check for C++ library yaml-cpp (AC_CHEC_LIB only supports checking for C libraries) +AC_MSG_CHECKING('libyaml-cpp available') +AC_LANG(C++) +SAVED_LDFLAGS=$LDFLAGS +LDFLAGS="$LDFLAGS -lyaml-cpp" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include ], [YAML::Emitter dummy])], + [ AC_MSG_RESULT([yes]) + SAVED_LDFLAGS="$SAVED_LDFLAGS -lyaml-cpp" + AC_DEFINE(HAVE_LIBYAML_CPP,1,[Define to 1 if you have libyaml-cpp installed]) ], + [AC_MSG_RESULT([no])]) +LDFLAGS=$SAVED_LDFLAGS + + + dnl user-switches AC_APPLICATIONS AC_DEBUG diff --git a/eo/test/Makefile.in b/eo/test/Makefile.in deleted file mode 100644 index 09f0d9479..000000000 --- a/eo/test/Makefile.in +++ /dev/null @@ -1,659 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -############################################################################### -############################################################################### - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -AS = @AS@ -CC = @CC@ -CXX = @CXX@ -DLLTOOL = @DLLTOOL@ -LD = @LD@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NM = @NM@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -VERSION = @VERSION@ - -DEPS = $(top_builddir)/src/libeo.a $(top_builddir)/src/obsolete/libeoobsolete.a $(top_builddir)/src/utils/libeoutils.a - -############################################################################### - -INCLUDES = -I$(top_builddir)/src -LDADDS = $(top_builddir)/src/libeo.a $(top_builddir)/src/obsolete/libeoobsolete.a $(top_builddir)/src/utils/libeoutils.a - -############################################################################### - -noinst_PROGRAMS = t-eobreeder t-eoinclusion t-eoinsertion t-eo t-eofitness t-eoproblem t-eobin t-eolottery t-eo2dVector t-eogeneration t-eoEasyEA t-eoNonUniform t-eoUniform t-eoRandom t-eoStateAndParser t-eoAtomOps t-selectOne t-eoGOpSel t-eoVector t-eoCheckpointing t-eoExternalEO t-eoESFull - - -############################################################################### - -t_eoVector_SOURCES = t-eoVector.cpp -t_eoVector_DEPENDENCIES = $(DEPS) -t_eoVector_LDFLAGS = -lm -t_eoVector_LDADD = $(LDADDS) - -############################################################################### - -t_eoGOpSel_SOURCES = t-eoGOpSel.cpp -t_eoGOpSel_DEPENDENCIES = $(DEPS) -t_eoGOpSel_LDFLAGS = -lm -t_eoGOpSel_LDADD = $(LDADDS) - -############################################################################### - -t_selectOne_SOURCES = t-selectOne.cpp -t_selectOne_DEPENDENCIES = $(DEPS) -t_selectOne_LDFLAGS = -lm -t_selectOne_LDADD = $(LDADDS) - -############################################################################### - -t_eoAtomOps_SOURCES = t-eoAtomOps.cpp -t_eoAtomOps_DEPENDENCIES = $(DEPS) -t_eoAtomOps_LDFLAGS = -lm -t_eoAtomOps_LDADD = $(LDADDS) - -############################################################################### -#disabled -#t_eoESOps_SOURCES = t-eoESOps.cpp -#t_eoESOps_DEPENDENCIES = $(DEPS) -#t_eoESOps_LDFLAGS = -lm -#t_eoESOps_LDADD = $(LDADDS) - -############################################################################### - -t_eoESFull_SOURCES = t-eoESFull.cpp real_value.h -t_eoESFull_DEPENDENCIES = $(DEPS) -t_eoESFull_LDFLAGS = -lm -t_eoESFull_LDADD = $(LDADDS) - -############################################################################### - -t_eoNonUniform_SOURCES = t-eoNonUniform.cpp -t_eoNonUniform_DEPENDENCIES = $(DEPS) -t_eoNonUniform_LDFLAGS = -lm -t_eoNonUniform_LDADD = $(LDADDS) - -############################################################################### - -t_eoUniform_SOURCES = t-eoUniform.cpp -t_eoUniform_DEPENDENCIES = $(DEPS) -t_eoUniform_LDFLAGS = -lm -t_eoUniform_LDADD = $(LDADDS) - -############################################################################### - -t_eoRandom_SOURCES = t-eoRandom.cpp -t_eoRandom_DEPENDENCIES = $(DEPS) -t_eoRandom_LDFLAGS = -lm -t_eoRandom_LDADD = $(LDADDS) - -############################################################################### - -t_eogeneration_SOURCES = t-eogeneration.cpp -t_eogeneration_DEPENDENCIES = $(DEPS) -t_eogeneration_LDFLAGS = -lm -t_eogeneration_LDADD = $(LDADDS) - -############################################################################### - -t_eoEasyEA_SOURCES = t-eoEasyEA.cpp binary_value.h -t_eoEasyEA_DEPENDENCIES = $(DEPS) -t_eoEasyEA_LDFLAGS = -lm -t_eoEasyEA_LDADD = $(LDADDS) - -############################################################################### - -t_eobreeder_SOURCES = t-eobreeder.cpp binary_value.h -t_eobreeder_DEPENDENCIES = $(DEPS) -t_eobreeder_LDFLAGS = -lm -t_eobreeder_LDADD = $(LDADDS) - -############################################################################### - -t_eoinclusion_SOURCES = t-eoinclusion.cpp -t_eoinclusion_DEPENDENCIES = $(DEPS) -t_eoinclusion_LDFLAGS = -lm -t_eoinclusion_LDADD = $(LDADDS) - -############################################################################### - -t_eoinsertion_SOURCES = t-eoinsertion.cpp -t_eoinsertion_DEPENDENCIES = $(DEPS) -t_eoinsertion_LDFLAGS = -lm -t_eoinsertion_LDADD = $(LDADDS) - -############################################################################### - -t_eo_SOURCES = t-eo.cpp -t_eo_DEPENDENCIES = $(DEPS) -t_eo_LDADD = $(LDADDS) - -############################################################################### - -t_eofitness_SOURCES = t-eofitness.cpp -t_eofitness_DEPENDENCIES = $(DEPS) -t_eofitness_LDADD = $(LDADDS) - -############################################################################### - -t_eoproblem_SOURCES = t-eoproblem.cpp -t_eoproblem_LDFLAGS = -lm - -############################################################################### - -t_eobin_SOURCES = t-eobin.cpp -t_eobin_DEPENDENCIES = $(DEPS) -t_eobin_LDADD = $(LDADDS) - -############################################################################### - -t_eolottery_SOURCES = t-eolottery.cpp -t_eolottery_DEPENDENCIES = $(DEPS) -t_eolottery_LDFLAGS = -lm -t_eolottery_LDADD = $(LDADDS) - -############################################################################### - -t_eo2dVector_SOURCES = t-eo2dVector.cc -t_eo2dVector_DEPENDENCIES = $(DEPS) -t_eo2dVector_LDFLAGS = -lm -t_eo2dVector_LDADD = $(LDADDS) - -############################################################################### - -t_eoStateAndParser_SOURCES = t-eoStateAndParser.cpp -t_eoStateAndParser_DEPENDENCIES = $(DEPS) -t_eoStateAndParser_LDFLAGS = -lm -t_eoStateAndParser_LDADD = $(LDADDS) - -############################################################################### - -t_eoCheckpointing_SOURCES = t-eoCheckpointing.cpp -t_eoCheckpointing_DEPENDENCIES = $(DEPS) -t_eoCheckpointing_LDFLAGS = -lm -t_eoCheckpointing_LDADD = $(LDADDS) - -############################################################################### - -t_eoExternalEO_SOURCES = t-eoExternalEO.cpp -t_eoExternalEO_DEPENDENCIES = $(DEPS) -t_eoExternalEO_LDFLAGS = -lm -t_eoExternalEO_LDADD = $(LDADDS) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -t_eobreeder_OBJECTS = t-eobreeder.o -t_eoinclusion_OBJECTS = t-eoinclusion.o -t_eoinsertion_OBJECTS = t-eoinsertion.o -t_eo_OBJECTS = t-eo.o -t_eo_LDFLAGS = -t_eofitness_OBJECTS = t-eofitness.o -t_eofitness_LDFLAGS = -t_eoproblem_OBJECTS = t-eoproblem.o -t_eoproblem_LDADD = $(LDADD) -t_eoproblem_DEPENDENCIES = -t_eobin_OBJECTS = t-eobin.o -t_eobin_LDFLAGS = -t_eolottery_OBJECTS = t-eolottery.o -t_eo2dVector_OBJECTS = t-eo2dVector.o -t_eogeneration_OBJECTS = t-eogeneration.o -t_eoEasyEA_OBJECTS = t-eoEasyEA.o -t_eoNonUniform_OBJECTS = t-eoNonUniform.o -t_eoUniform_OBJECTS = t-eoUniform.o -t_eoRandom_OBJECTS = t-eoRandom.o -t_eoStateAndParser_OBJECTS = t-eoStateAndParser.o -t_eoAtomOps_OBJECTS = t-eoAtomOps.o -t_selectOne_OBJECTS = t-selectOne.o -t_eoGOpSel_OBJECTS = t-eoGOpSel.o -t_eoVector_OBJECTS = t-eoVector.o -t_eoCheckpointing_OBJECTS = t-eoCheckpointing.o -t_eoExternalEO_OBJECTS = t-eoExternalEO.o -t_eoESFull_OBJECTS = t-eoESFull.o -CXXFLAGS = @CXXFLAGS@ -CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -DEP_FILES = .deps/t-eo.P .deps/t-eo2dVector.P .deps/t-eoAtomOps.P \ -.deps/t-eoCheckpointing.P .deps/t-eoESFull.P .deps/t-eoEasyEA.P \ -.deps/t-eoExternalEO.P .deps/t-eoGOpSel.P .deps/t-eoNonUniform.P \ -.deps/t-eoRandom.P .deps/t-eoStateAndParser.P .deps/t-eoUniform.P \ -.deps/t-eoVector.P .deps/t-eobin.P .deps/t-eobreeder.P \ -.deps/t-eofitness.P .deps/t-eogeneration.P .deps/t-eoinclusion.P \ -.deps/t-eoinsertion.P .deps/t-eolottery.P .deps/t-eoproblem.P \ -.deps/t-selectOne.P -SOURCES = $(t_eobreeder_SOURCES) $(t_eoinclusion_SOURCES) $(t_eoinsertion_SOURCES) $(t_eo_SOURCES) $(t_eofitness_SOURCES) $(t_eoproblem_SOURCES) $(t_eobin_SOURCES) $(t_eolottery_SOURCES) $(t_eo2dVector_SOURCES) $(t_eogeneration_SOURCES) $(t_eoEasyEA_SOURCES) $(t_eoNonUniform_SOURCES) $(t_eoUniform_SOURCES) $(t_eoRandom_SOURCES) $(t_eoStateAndParser_SOURCES) $(t_eoAtomOps_SOURCES) $(t_selectOne_SOURCES) $(t_eoGOpSel_SOURCES) $(t_eoVector_SOURCES) $(t_eoCheckpointing_SOURCES) $(t_eoExternalEO_SOURCES) $(t_eoESFull_SOURCES) -OBJECTS = $(t_eobreeder_OBJECTS) $(t_eoinclusion_OBJECTS) $(t_eoinsertion_OBJECTS) $(t_eo_OBJECTS) $(t_eofitness_OBJECTS) $(t_eoproblem_OBJECTS) $(t_eobin_OBJECTS) $(t_eolottery_OBJECTS) $(t_eo2dVector_OBJECTS) $(t_eogeneration_OBJECTS) $(t_eoEasyEA_OBJECTS) $(t_eoNonUniform_OBJECTS) $(t_eoUniform_OBJECTS) $(t_eoRandom_OBJECTS) $(t_eoStateAndParser_OBJECTS) $(t_eoAtomOps_OBJECTS) $(t_selectOne_OBJECTS) $(t_eoGOpSel_OBJECTS) $(t_eoVector_OBJECTS) $(t_eoCheckpointing_OBJECTS) $(t_eoExternalEO_OBJECTS) $(t_eoESFull_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .cc .cpp .lo .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstPROGRAMS: - -clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) - -distclean-noinstPROGRAMS: - -maintainer-clean-noinstPROGRAMS: - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -.s.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -.S.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -maintainer-clean-libtool: - -t-eobreeder: $(t_eobreeder_OBJECTS) $(t_eobreeder_DEPENDENCIES) - @rm -f t-eobreeder - $(CXXLINK) $(t_eobreeder_LDFLAGS) $(t_eobreeder_OBJECTS) $(t_eobreeder_LDADD) $(LIBS) - -t-eoinclusion: $(t_eoinclusion_OBJECTS) $(t_eoinclusion_DEPENDENCIES) - @rm -f t-eoinclusion - $(CXXLINK) $(t_eoinclusion_LDFLAGS) $(t_eoinclusion_OBJECTS) $(t_eoinclusion_LDADD) $(LIBS) - -t-eoinsertion: $(t_eoinsertion_OBJECTS) $(t_eoinsertion_DEPENDENCIES) - @rm -f t-eoinsertion - $(CXXLINK) $(t_eoinsertion_LDFLAGS) $(t_eoinsertion_OBJECTS) $(t_eoinsertion_LDADD) $(LIBS) - -t-eo: $(t_eo_OBJECTS) $(t_eo_DEPENDENCIES) - @rm -f t-eo - $(CXXLINK) $(t_eo_LDFLAGS) $(t_eo_OBJECTS) $(t_eo_LDADD) $(LIBS) - -t-eofitness: $(t_eofitness_OBJECTS) $(t_eofitness_DEPENDENCIES) - @rm -f t-eofitness - $(CXXLINK) $(t_eofitness_LDFLAGS) $(t_eofitness_OBJECTS) $(t_eofitness_LDADD) $(LIBS) - -t-eoproblem: $(t_eoproblem_OBJECTS) $(t_eoproblem_DEPENDENCIES) - @rm -f t-eoproblem - $(CXXLINK) $(t_eoproblem_LDFLAGS) $(t_eoproblem_OBJECTS) $(t_eoproblem_LDADD) $(LIBS) - -t-eobin: $(t_eobin_OBJECTS) $(t_eobin_DEPENDENCIES) - @rm -f t-eobin - $(CXXLINK) $(t_eobin_LDFLAGS) $(t_eobin_OBJECTS) $(t_eobin_LDADD) $(LIBS) - -t-eolottery: $(t_eolottery_OBJECTS) $(t_eolottery_DEPENDENCIES) - @rm -f t-eolottery - $(CXXLINK) $(t_eolottery_LDFLAGS) $(t_eolottery_OBJECTS) $(t_eolottery_LDADD) $(LIBS) - -t-eo2dVector: $(t_eo2dVector_OBJECTS) $(t_eo2dVector_DEPENDENCIES) - @rm -f t-eo2dVector - $(CXXLINK) $(t_eo2dVector_LDFLAGS) $(t_eo2dVector_OBJECTS) $(t_eo2dVector_LDADD) $(LIBS) - -t-eogeneration: $(t_eogeneration_OBJECTS) $(t_eogeneration_DEPENDENCIES) - @rm -f t-eogeneration - $(CXXLINK) $(t_eogeneration_LDFLAGS) $(t_eogeneration_OBJECTS) $(t_eogeneration_LDADD) $(LIBS) - -t-eoEasyEA: $(t_eoEasyEA_OBJECTS) $(t_eoEasyEA_DEPENDENCIES) - @rm -f t-eoEasyEA - $(CXXLINK) $(t_eoEasyEA_LDFLAGS) $(t_eoEasyEA_OBJECTS) $(t_eoEasyEA_LDADD) $(LIBS) - -t-eoNonUniform: $(t_eoNonUniform_OBJECTS) $(t_eoNonUniform_DEPENDENCIES) - @rm -f t-eoNonUniform - $(CXXLINK) $(t_eoNonUniform_LDFLAGS) $(t_eoNonUniform_OBJECTS) $(t_eoNonUniform_LDADD) $(LIBS) - -t-eoUniform: $(t_eoUniform_OBJECTS) $(t_eoUniform_DEPENDENCIES) - @rm -f t-eoUniform - $(CXXLINK) $(t_eoUniform_LDFLAGS) $(t_eoUniform_OBJECTS) $(t_eoUniform_LDADD) $(LIBS) - -t-eoRandom: $(t_eoRandom_OBJECTS) $(t_eoRandom_DEPENDENCIES) - @rm -f t-eoRandom - $(CXXLINK) $(t_eoRandom_LDFLAGS) $(t_eoRandom_OBJECTS) $(t_eoRandom_LDADD) $(LIBS) - -t-eoStateAndParser: $(t_eoStateAndParser_OBJECTS) $(t_eoStateAndParser_DEPENDENCIES) - @rm -f t-eoStateAndParser - $(CXXLINK) $(t_eoStateAndParser_LDFLAGS) $(t_eoStateAndParser_OBJECTS) $(t_eoStateAndParser_LDADD) $(LIBS) - -t-eoAtomOps: $(t_eoAtomOps_OBJECTS) $(t_eoAtomOps_DEPENDENCIES) - @rm -f t-eoAtomOps - $(CXXLINK) $(t_eoAtomOps_LDFLAGS) $(t_eoAtomOps_OBJECTS) $(t_eoAtomOps_LDADD) $(LIBS) - -t-selectOne: $(t_selectOne_OBJECTS) $(t_selectOne_DEPENDENCIES) - @rm -f t-selectOne - $(CXXLINK) $(t_selectOne_LDFLAGS) $(t_selectOne_OBJECTS) $(t_selectOne_LDADD) $(LIBS) - -t-eoGOpSel: $(t_eoGOpSel_OBJECTS) $(t_eoGOpSel_DEPENDENCIES) - @rm -f t-eoGOpSel - $(CXXLINK) $(t_eoGOpSel_LDFLAGS) $(t_eoGOpSel_OBJECTS) $(t_eoGOpSel_LDADD) $(LIBS) - -t-eoVector: $(t_eoVector_OBJECTS) $(t_eoVector_DEPENDENCIES) - @rm -f t-eoVector - $(CXXLINK) $(t_eoVector_LDFLAGS) $(t_eoVector_OBJECTS) $(t_eoVector_LDADD) $(LIBS) - -t-eoCheckpointing: $(t_eoCheckpointing_OBJECTS) $(t_eoCheckpointing_DEPENDENCIES) - @rm -f t-eoCheckpointing - $(CXXLINK) $(t_eoCheckpointing_LDFLAGS) $(t_eoCheckpointing_OBJECTS) $(t_eoCheckpointing_LDADD) $(LIBS) - -t-eoExternalEO: $(t_eoExternalEO_OBJECTS) $(t_eoExternalEO_DEPENDENCIES) - @rm -f t-eoExternalEO - $(CXXLINK) $(t_eoExternalEO_LDFLAGS) $(t_eoExternalEO_OBJECTS) $(t_eoExternalEO_LDADD) $(LIBS) - -t-eoESFull: $(t_eoESFull_OBJECTS) $(t_eoESFull_DEPENDENCIES) - @rm -f t-eoESFull - $(CXXLINK) $(t_eoESFull_LDFLAGS) $(t_eoESFull_OBJECTS) $(t_eoESFull_LDADD) $(LIBS) -.cc.o: - $(CXXCOMPILE) -c $< -.cc.lo: - $(LTCXXCOMPILE) -c $< -.cpp.o: - $(CXXCOMPILE) -c $< -.cpp.lo: - $(LTCXXCOMPILE) -c $< - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = test - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu test/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - -DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) - --include $(DEP_FILES) - -mostlyclean-depend: - -clean-depend: - -distclean-depend: - -rm -rf .deps - -maintainer-clean-depend: - -%.o: %.c - @echo '$(COMPILE) -c $<'; \ - $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - -%.lo: %.c - @echo '$(LTCOMPILE) -c $<'; \ - $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp - -%.o: %.cc - @echo '$(CXXCOMPILE) -c $<'; \ - $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - -%.lo: %.cc - @echo '$(LTCXXCOMPILE) -c $<'; \ - $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp - -%.o: %.cpp - @echo '$(CXXCOMPILE) -c $<'; \ - $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - -%.lo: %.cpp - @echo '$(LTCXXCOMPILE) -c $<'; \ - $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(PROGRAMS) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ - mostlyclean-libtool mostlyclean-tags mostlyclean-depend \ - mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \ - clean-depend clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstPROGRAMS distclean-compile \ - distclean-libtool distclean-tags distclean-depend \ - distclean-generic clean-am - -rm -f libtool - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-tags maintainer-clean-depend \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ -clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile mostlyclean-libtool distclean-libtool \ -clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir \ -mostlyclean-depend distclean-depend clean-depend \ -maintainer-clean-depend info-am info dvi-am dvi check check-am \ -installcheck-am installcheck install-exec-am install-exec \ -install-data-am install-data install-am install uninstall-am uninstall \ -all-redirect all-am all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean - - -############################################################################### - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/eo/tutorial/html/index.html b/eo/tutorial/html/index.html deleted file mode 100644 index 00734f654..000000000 --- a/eo/tutorial/html/index.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - Tutorial EO - - -Algorithm-Based - Component-Based -- Programming hints - EO -documentation -
-
Welcome to EO, the Evolving Objects library, -and to -  -

-EO Tutorial

- -
Version 0.92 - Jan. 5 2001
- -

The short term idea of this tutorial is to help you build -your own Evolutionary Algorithms using EO - while the long term -idea is that you will be able to contribute to EO, and ultimately write -our -EAs :-) -

- -
About this tutorial

-This tutorial can be used in 2 different ways: algorithm-based and component-based. -
    -
  • -Algorithm-Based means you start from a very -simple, ready-to-run algorithm, and gradually modify it, making -it both more powerful and more complex.
  • - -
  • -Component-Based means you start by examining -the -components of an EA one by one, down to -the level of complexity you feel comfortable with, and then build the whole -algorithm using those components you need (or the one you are mastering). -Such approach might be viewed as going through a simplified user guide, -too.
  • -
-However, it is strongly recommended -that you take some time on the first lesson of the Algorithm-Based approach -to get familiar with the basic concepts that are used throughout EO. Anyway, -as of today, December 19, the Component-Based is only very sparsely written -:-) -

-


Links and Related -documents -
    -
  • -There are of course a few (very few) programming -hints that you should know.
  • - -
  • -THe EO documentation - automatically -generated from the comments in the code - is very helpful to get an idea -of the inheritance diagrams of EO classes, -and to quickly reach some specific part of the code.
  • - -
    The top page of each class documentation is for instance the inheritance -diagram of the class, and you'll learn a lot by simply looking at it. -
  • -And, last but not least, we assume you know approximately that an Evolutionary -Algorithm looks like this, but otherwise you can try this very -brief introduction (not written yet, Jan. 2001, sorry).
  • -
- -


-


Colors and navigation: -

You will see this diagram in quite many places, as for instance at the -top of all examples - usually it will be clickable and will help you navigate -among the different parts of an EO program. See the brief -introduction to Evolutionary Computation for a detailed explanation. -

-

- -

But in the text itself, colors are important, -as they will be used throughout this tutorial to clearly mark which part -of the algorithm we are discussing. So please keep in mind that, whereas -orange -is for emphasis, -

    -
  • -Yellowish is for representation, -i.e. the choice of the genotype
  • - -
  • -Magenta is for the stochastic -operators that are representation-dependent, -i.e. initialisation and variation operators -(crossover, mutation -and the like).
  • - -
  • -Green is for the implementation of Darwinism, -i.e. the way the individuals are selected -for reproduction and survive.
  • - -
  • -Red is for evaluation, i.e. the computation -of the fitness of all individuals
  • - -
  • -Blue is for interactions of the user and the -program, as for instance choice of stopping criterion, -on-line display of nice statistics or initial -choice -of all program parameters.
  • - -
  • -Brown is for everything that is NOT part of -any of the above, i.e. random number generator, or basic C++/STL syntax -.
  • - -
  • -Note that pink will be used to describe the -syntax of compile orders (i.e. at the operating system level, see e.g. -below).
  • - -
  • -Last, but not least, all -links into EO documentation will use the Helvetica typeface, like this -line you are now reading.
  • -
- -
This tutorial is -not -
    -
  • -A course on Evolutionary Computation. You can find such things on the Internet, -maybe you can start here.
  • - -
  • -An interface that would allow you to build your Evolutionary Programs by -a few clicks; such a thing does exist, is called EASEA, -and is complementary to this tutorial as it helps the user to build some -simple EO programs from simple description. But there are things that EASEA -cannot do, and you will have to do it yourself and will need to increase -your knowledge about EO for that - hence this tutorial.
  • - -
  • -A coffee machine - though you might want to spend some time here when you're -tired of everything else, to improve your knowledge of EO slowly and gradually -rather than when you have something urgent to code :-)
  • -
- -
Before -you start -

You should of course have downloaded and installed the whole EO -library (how did you get this file if not???). -
So we'll assume that you are now in the Tutorial directory, and that -your prompt looks something like -

(myname@myhost) EOdir/Tutorial % -

so you should now type in -

make lesson1 -

and see something like -

(myname@myhost) -EOdir/Tutorial % make lesson1 -
c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" --I. -I../../src -Wall -g -c FirstBitGA.cpp -
c++ -Wall -g -o FirstBitGA FirstBitGA.o -../../src/libeo.a ../../src/utils/libeoutils.a -
c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" --I. -I../../src -Wall -g -c FirstRealGA.cpp -
c++ -Wall -g -o FirstRealGA FirstRealGA.o -../../src/libeo.a ../../src/utils/libeoutils.a -

and two now executable files should have appeared in the subdirectory -Lesson1, namely FirstBitGA -and FirstRealGA (see First -lesson to know more about these two ready-to-run programs). If this -doesn't work, please go back to the main EO directory and run the installation -program. -

You should also test that you can access the EO documentation in the -menu line below: you might not need to go there immediately, but just in -case you make rapid progress ... This menu bar should be on all pages of -this tutorial, allowing you to navigate easily. -

Last, but not least: EO is improving only  from the good will of -contributors. This is also true for this tutorial: If you find anything -that you think could be improved, you are welcome to e-mail -me. -

-

Enjoy! -


Algorithm-Based -- Component-Based - Programming -hints - EO -documentation
- -
-
-Marc Schoenauer
- -
Last -modified: Fri Nov 28 2000  - -