summaryrefslogtreecommitdiffstats
path: root/ai/Node.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-06-04 01:35:20 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-06-04 01:35:20 +0000
commit3595239f08f2bc1df32ef22ed6de9bde10ca3384 (patch)
treed9962c84e3a1f19e2da422f9bb49f65c21ada9f6 /ai/Node.cpp
parentc9afda3ab74614fb36986f96b7972c082f275eca (diff)
downloadsigen-3595239f08f2bc1df32ef22ed6de9bde10ca3384.tar.gz
sigen-3595239f08f2bc1df32ef22ed6de9bde10ca3384.tar.xz
sigen-3595239f08f2bc1df32ef22ed6de9bde10ca3384.zip
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
Diffstat (limited to 'ai/Node.cpp')
-rw-r--r--ai/Node.cpp6
1 files changed, 3 insertions, 3 deletions
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
}