⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 visualstub.cpp

📁 amygdata的神经网络算法源代码
💻 CPP
字号:
/***************************************************************************                          visualstub.cpp  -  description                             -------------------    begin                : Thu Feb 5 2004    copyright            : (C) 2004 by Rdiger Koch    email                : rkoch@amygdala.org ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#include "visualstub.h"#include "logging.h"#include <stdexcept>#include <iostream>#include <ltdl.h>using namespace Amygdala;VisualStub::VisualStub(){}VisualStub::~VisualStub(){}void VisualStub::Init(int & argc, char * argv[]){    const char * error;    if(lt_dlinit()) throw std::runtime_error("Could not initialize libtldl");    visualHandle = lt_dlopen("libvisualamygdala.so");    if (!visualHandle)             throw std::runtime_error(lt_dlerror());    c_InitVisual = (InitVisualFunc)lt_dlsym(visualHandle, "InitVisual");    if (c_InitVisual == NULL && (error = lt_dlerror()) != NULL) throw std::runtime_error(error);    c_RunVisual = (RunVisualFunc) lt_dlsym(visualHandle, "RunVisual");    if (c_RunVisual == NULL && (error = lt_dlerror()) != NULL) throw std::runtime_error(error);    c_RunGA = (RunGAFunc) lt_dlsym(visualHandle, "RunGA");    if (c_RunGA == NULL && (error = lt_dlerror()) != NULL) throw std::runtime_error(error);    if(c_InitVisual(&argc, argv) == NULL) throw std::runtime_error("Could not create Visual Object");}void VisualStub::RunVisual() {    LOGGER(1, "Running the Visualizer NN mode");    c_RunVisual();}void VisualStub::RunGA(GenomeHandler * gh) {    std::cout << "Running the Visualizer in GA mode" << std::endl;    c_RunGA(gh);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -