}
@Override
public void addTradingAgentFactory(ITradingAgentFactory factory) {
super.addTradingAgentFactory(factory);
TradingAgentFactoryHandle factoryHandle = new TradingAgentFactoryHandle(factory.getClass().getName(), factory.getConfigurationKeys());
if (persistenceDirectory.exists() && persistenceDirectory.isDirectory()) {
File[] dirFiles = persistenceDirectory.listFiles();
String dataFileName = factoryHandle.getPrettyName() + ".hierarchy";
for (File file : dirFiles) {
if (file.getName().equals(dataFileName)) {
try {
FileInputStream inputStream = new FileInputStream(file);
restoreFactoryHierarchy(factoryHandle, inputStream);