void TrainerTestController::run() {

    if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
        return;

    fuzzy f;
    f.input1[0][0] = 0.00;
    f.input1[0][1] = 0.50;
    f.input1[1][0] = 0.25;
    f.input1[1][1] = 0.75;
    f.input1[2][0] = 0.50;
    f.input1[2][1] = 1.00;

    f.input2[0][0] = -1.00;
    f.input2[0][1] = -0.25;
    f.input2[1][0] = -0.50;
    f.input2[1][1] =  0.50;
    f.input2[2][0] =  0.25;
    f.input2[2][1] =  1.00;

    f.output[0][0] = -2.00;
    f.output[0][1] =  0.00;
    f.output[1][0] = -1.00;
    f.output[1][1] =  0.00;
    f.output[2][0] = -0.50;
    f.output[2][1] =  0.50;
    f.output[3][0] =  0.00;
    f.output[3][1] =  1.00;

    doSimulation(f);
}
Exemple #2
0
// No error checking
int main(int argc, char** argv) {

    // Initialize
    DATA_DIR     = demoFindData();
    debugLog	 = new Log;
    renderDevice = new RenderDevice;
    RenderDeviceSettings settings;
    settings.fsaaSamples = 1;
    settings.resizable = true;
    renderDevice->init(settings, debugLog);

    userInput    = new UserInput();

    font         = GFont::fromFile(renderDevice, DATA_DIR + "font/dominant.fnt");

    controller   = new ManualCameraController(renderDevice, userInput);

    controller->setMoveRate(10);
    controller->setPosition(Vector3(0.0f, 0.0f, 4.0f));
    controller->lookAt(Vector3(-2.0f, 3.0f, -5.0f));

    controller->setActive(true);

    renderDevice->resetState();
	renderDevice->setColorClearValue(Color3(0.1f, 0.5f, 1.0f));

    RealTime now = System::getTick() - 0.001f, lastTime;

    // Main loop
    do {
        lastTime = now;
        now = System::getTick();
        RealTime timeStep = now - lastTime;

        doUserInput();

        doSimulation(timeStep);

        doGraphics();
   
    } while ( !endProgram );

    // Cleanup
    delete controller;
    delete userInput;
    renderDevice->cleanup();
    delete renderDevice;
    delete debugLog;

    return 0;
}