Index: configure.ac
===================================================================
--- configure.ac	(revision 081e5d776b34e30d39d3d2bd6b9706066bba6950)
+++ configure.ac	(revision 6ff0c86cbaac5717bf62b0ad078300179e43e3e1)
@@ -115,6 +115,6 @@
 #AC_MSG_NOTICE(["GLU_CFLAGS: $GLU_CFLAGS, GLU_CXXFLAGS: $GLU_CXXFLAGS, GLU_LDFLAGS: $GLU_LDFLAGS, GLU_LIBS: $GLU_LIBS"])
 
-# CodePatterns library (needs Prototype factory pattern)
-AM_PATH_CODEPATTERNS([1.0.5], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
+# CodePatterns library (needs PrototypeFactory::getPrototype())
+AM_PATH_CODEPATTERNS([1.0.7], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
 
 # Checks for header files.
Index: src/Actions/RandomNumbersAction/SetRandomNumbersEngineAction.cpp
===================================================================
--- src/Actions/RandomNumbersAction/SetRandomNumbersEngineAction.cpp	(revision 081e5d776b34e30d39d3d2bd6b9706066bba6950)
+++ src/Actions/RandomNumbersAction/SetRandomNumbersEngineAction.cpp	(revision 6ff0c86cbaac5717bf62b0ad078300179e43e3e1)
@@ -25,5 +25,6 @@
 #include "World.hpp"
 
-#include "RandomNumbers/RandomNumberGeneratorFactory.hpp"
+#include "RandomNumbers/RandomNumberEngine.hpp"
+#include "RandomNumbers/RandomNumberEngineFactory.hpp"
 
 #include <iostream>
@@ -43,12 +44,23 @@
   getParametersfromValueStorage();
 
+  // create a new state for undo
   CommandSetRandomNumbersEngineState *state =
       new CommandSetRandomNumbersEngineState(
-          RandomNumberGeneratorFactory::getInstance().getEngineName(),
+          RandomNumberEngineFactory::getInstance().getCurrentTypeName(),
+          RandomNumberEngineFactory::getInstance().getPrototype().getseed(),
           params);
-  RandomNumberGeneratorFactory::getInstance().setEngine(params.engine_type);
+  // set new default
+  RandomNumberEngineFactory::getInstance().setCurrentType(params.engine_type);
+  // set new seed if given, have to use ugly const_cast as prototype is not manipulable
+  if (params.seed != -1) {
+    RandomNumberEngine &engine =
+        const_cast<RandomNumberEngine &>(
+            RandomNumberEngineFactory::getInstance().getPrototype(params.engine_type)
+            );
+    engine.seed(params.seed);
+  }
 
-  DoLog(0) && (Log() << Verbose(0) << "Engine of random number generator is now: "
-      << RandomNumberGeneratorFactory::getInstance().getEngineName() << std::endl);
+  DoLog(0) && (Log() << Verbose(0) << "Default random number engine is now: "
+      << RandomNumberEngineFactory::getInstance().getCurrentTypeName() << std::endl);
 
   return Action::state_ptr(state);
@@ -56,14 +68,25 @@
 
 Action::state_ptr CommandSetRandomNumbersEngineAction::performUndo(Action::state_ptr _state) {
-  CommandSetRandomNumbersEngineState *state = assert_cast<CommandSetRandomNumbersEngineState*>(_state.get());
+  CommandSetRandomNumbersEngineState *state =
+      assert_cast<CommandSetRandomNumbersEngineState*>(_state.get());
 
+  // create a new state for redo
   CommandSetRandomNumbersEngineState *newstate =
       new CommandSetRandomNumbersEngineState(
-          RandomNumberGeneratorFactory::getInstance().getEngineName(),
+          RandomNumberEngineFactory::getInstance().getCurrentTypeName(),
+          RandomNumberEngineFactory::getInstance().getPrototype().getseed(),
           state->params);
-  RandomNumberGeneratorFactory::getInstance().setEngine(state->old_engine_type);
+  // set new default
+  RandomNumberEngineFactory::getInstance().setCurrentType(state->old_engine_type);
+  RandomNumberEngine &engine = const_cast<RandomNumberEngine &>(
+      RandomNumberEngineFactory::getInstance().getPrototype(state->params.engine_type)
+    );
+  // set new seed if given, have to use ugly const_cast as prototype is not manipulable
+  if (state->params.seed != -1) {
+    engine.seed(state->params.seed);
+  }
 
-  DoLog(0) && (Log() << Verbose(0) << "Engine of random number generator is undone to: "
-      << RandomNumberGeneratorFactory::getInstance().getEngineName() << std::endl);
+  DoLog(0) && (Log() << Verbose(0) << "Default random number engine is undone to: "
+      << RandomNumberEngineFactory::getInstance().getCurrentTypeName() << std::endl);
 
   return Action::state_ptr(newstate);
Index: src/Actions/RandomNumbersAction/SetRandomNumbersEngineAction.def
===================================================================
--- src/Actions/RandomNumbersAction/SetRandomNumbersEngineAction.def	(revision 081e5d776b34e30d39d3d2bd6b9706066bba6950)
+++ src/Actions/RandomNumbersAction/SetRandomNumbersEngineAction.def	(revision 6ff0c86cbaac5717bf62b0ad078300179e43e3e1)
@@ -12,12 +12,12 @@
 // ValueStorage by the token "Z" -> first column: int, Z, "Z"
 // "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
-#define paramtypes (std::string)
-#define paramtokens ("set-random-number-engine")
-#define paramdescriptions ("name of the pseudo-random engine from boost::random")
-#undef paramdefaults
-#define paramreferences (engine_type)
+#define paramtypes (std::string)(int)
+#define paramtokens ("set-random-number-engine")("random-number-seed")
+#define paramdescriptions ("name of the pseudo-random engine from boost::random")("seed of the pseudo-random number sequence")
+#define paramdefaults (NODEFAULT)("-1")
+#define paramreferences (engine_type)(seed)
 
-#define statetypes (std::string)
-#define statereferences (old_engine_type)
+#define statetypes (std::string)(int)
+#define statereferences (old_engine_type)(old_seed)
 
 // some defines for all the names, you may use ACTION, STATE and PARAMS
Index: src/RandomNumbers/RandomNumberEngine.hpp
===================================================================
--- src/RandomNumbers/RandomNumberEngine.hpp	(revision 081e5d776b34e30d39d3d2bd6b9706066bba6950)
+++ src/RandomNumbers/RandomNumberEngine.hpp	(revision 6ff0c86cbaac5717bf62b0ad078300179e43e3e1)
@@ -43,4 +43,10 @@
   virtual void seed(unsigned int _seed)=0;
 
+  /** Getter for the generator's seed.
+   *
+   * @return _seed seed to set to
+   */
+  virtual unsigned int getseed() const = 0;
+
   /** Getter for smallest value the engine produces.
    *
@@ -72,12 +78,4 @@
    */
   RandomNumberEngine() {};
-
-  /** Getter for the generator's seed.
-   *
-   * @note is only used internally for unit test.
-   *
-   * @return _seed seed to set to
-   */
-  virtual unsigned int getseed() const = 0;
 };
 
Index: src/RandomNumbers/RandomNumberEngineFactory.hpp
===================================================================
--- src/RandomNumbers/RandomNumberEngineFactory.hpp	(revision 081e5d776b34e30d39d3d2bd6b9706066bba6950)
+++ src/RandomNumbers/RandomNumberEngineFactory.hpp	(revision 6ff0c86cbaac5717bf62b0ad078300179e43e3e1)
@@ -27,4 +27,5 @@
 class RandomNumberEngine;
 class RandomNumberEngineFactoryUnitTest;
+class CommandSetRandomNumbersEngineAction;
 
 /** This is the Prototype factory class for random number engines.
@@ -43,4 +44,5 @@
   friend class Singleton<RandomNumberEngineFactory>;
   friend class RandomNumberEngineFactoryTest;
+  friend class CommandSetRandomNumbersEngineAction;
 
 protected:
Index: src/RandomNumbers/RandomNumberEngineFactory.undef
===================================================================
--- src/RandomNumbers/RandomNumberEngineFactory.undef	(revision 081e5d776b34e30d39d3d2bd6b9706066bba6950)
+++ src/RandomNumbers/RandomNumberEngineFactory.undef	(revision 6ff0c86cbaac5717bf62b0ad078300179e43e3e1)
@@ -1,4 +1,6 @@
 #ifdef RANDOMNUMBERENGINEFACTORY_DEF_
 
+#undef engine_seq
+#undef engine_seq_a
 #undef type_seq
 #undef type_seq_size
