Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/WireFitQLearn.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class WireFitQLearn : public Learner {
/** Stores this model in a stream. */
void store(std::ofstream *output);

~WireFitQLearn();

protected:
// Feeds the state into the network, parses to the output of the network into wire form, and outputs these wires
std::vector<Wire> getWires(State state);
Expand Down
6 changes: 6 additions & 0 deletions src/WireFitQLearn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ WireFitQLearn::WireFitQLearn(std::ifstream *input) {

}

WireFitQLearn::~WireFitQLearn() {
delete modelNet;
delete network;
}

Action WireFitQLearn::chooseBestAction(State currentState) {
std::vector<double> action = bestAction(currentState);
lastAction = action;
Expand Down Expand Up @@ -105,6 +110,7 @@ void WireFitQLearn::applyReinforcementToLastAction(double reward, State newState
}

void WireFitQLearn::reset() {
delete network;
network = new net::NeuralNet(modelNet);
network->randomizeWeights();
std::cout << "number: " << network->numberOfHiddenNeurons() << "\n";
Expand Down