From 3595239f08f2bc1df32ef22ed6de9bde10ca3384 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 4 Jun 2007 01:35:20 +0000 Subject: Style cleanup, minor Matrix fixes, duplication validations, Pokemod methods git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@19 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- ai/Node.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ai/Node.cpp') diff --git a/ai/Node.cpp b/ai/Node.cpp index c95d6eae..9fc723d6 100644 --- a/ai/Node.cpp +++ b/ai/Node.cpp @@ -40,7 +40,7 @@ void PokeGen::NeuralNetwork::Node::UpdateWeights(int n) { if (n < 0) { - weights.push_back((abs(std::rand())%201)/100.0); + weights.push_back((abs(std::rand()) % 201) / 100.0); weightChanges.push_back(0); } else if (n < ownerLayer->child->GetNumNodes()) @@ -87,7 +87,7 @@ void PokeGen::NeuralNetwork::Node::RandomizeWeights() weights.clear(); int i = 0; for (; i < ownerLayer->child->GetNumNodes(); ++i) - weights.push_back((abs(std::rand())%201)/100.0); + weights.push_back((abs(std::rand()) % 201) / 100.0); weightChanges.clear(); weightChanges.resize(i - 1, 0); } @@ -208,5 +208,5 @@ void PokeGen::NeuralNetwork::Node::CalculateValue() void PokeGen::NeuralNetwork::Node::DumpData(const std::string &f) { - + // TODO (Ben#1#): Dump NeuralNode data } -- cgit