├── README.md ├── doc ├── DataInterrelationalGraph-Inheritance.svg ├── DataInterrelationalGraph-Inheritance.uxf ├── DataInterrelationalGraph-Ownership.svg ├── DataInterrelationalGraph-Ownership.uxf ├── Genetics.uxf ├── LICENSE ├── Neuron.gif ├── Neuron.uxf ├── Neuron.vsd └── README ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── syncleus │ │ └── dann │ │ ├── ComponentUnavailableException.java │ │ ├── DannError.java │ │ ├── DannException.java │ │ ├── DannRuntimeException.java │ │ ├── UnexpectedDannError.java │ │ ├── UnexpectedInterruptedException.java │ │ ├── attributes │ │ ├── AbstractAttributePool.java │ │ ├── Attribute.java │ │ ├── AttributeChangeListener.java │ │ ├── AttributePool.java │ │ ├── IntegerAttribute.java │ │ ├── SimpleAttribute.java │ │ ├── StringAttribute.java │ │ ├── hat │ │ │ ├── AbstractHierarchicalAttributePool.java │ │ │ ├── HierarchicalAttributePool.java │ │ │ ├── HierarchicalAttributeTreeGraph.java │ │ │ ├── MutableAttributeTreeAdjacencyGraph.java │ │ │ └── MutableHierarchicalAttributeTreeGraph.java │ │ └── package-info.java │ │ ├── classify │ │ ├── Classifier.java │ │ ├── LanguageClassifier.java │ │ ├── Trainable.java │ │ ├── TrainableClassifier.java │ │ ├── TrainableLanguageClassifier.java │ │ ├── naive │ │ │ ├── ClassificationProbabilities.java │ │ │ ├── FeatureClassificationTree.java │ │ │ ├── FeatureExtractor.java │ │ │ ├── LanguageNaiveClassifier.java │ │ │ ├── NaiveClassifier.java │ │ │ ├── SimpleLanguageNaiveClassifier.java │ │ │ ├── SimpleNaiveClassifier.java │ │ │ ├── StemmingLanguageNaiveClassifier.java │ │ │ ├── TrainableLanguageNaiveClassifier.java │ │ │ ├── TrainableNaiveClassifier.java │ │ │ ├── bayes │ │ │ │ ├── LanguageNaiveBayesClassifier.java │ │ │ │ ├── NaiveBayesClassifier.java │ │ │ │ ├── SimpleLanguageNaiveBayesClassifier.java │ │ │ │ ├── SimpleNaiveBayesClassifier.java │ │ │ │ ├── StemmingLanguageNaiveBayesClassifier.java │ │ │ │ ├── TrainableLanguageNaiveBayesClassifier.java │ │ │ │ ├── TrainableNaiveBayesClassifier.java │ │ │ │ ├── fisher │ │ │ │ │ ├── FisherClassifier.java │ │ │ │ │ ├── LanguageFisherClassifier.java │ │ │ │ │ ├── SimpleFisherClassifier.java │ │ │ │ │ ├── SimpleLanguageFisherClassifier.java │ │ │ │ │ ├── StemmingLanguageFisherClassifier.java │ │ │ │ │ ├── TrainableFisherClassifier.java │ │ │ │ │ ├── TrainableLanguageFisherClassifier.java │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ └── package-info.java │ │ ├── dataprocessing │ │ ├── language │ │ │ ├── package-info.java │ │ │ └── parsing │ │ │ │ ├── BasicWordParser.java │ │ │ │ ├── WordParser.java │ │ │ │ ├── package-info.java │ │ │ │ └── stem │ │ │ │ ├── PorterStemmer.java │ │ │ │ ├── Stemmer.java │ │ │ │ ├── StemmingWordParser.java │ │ │ │ └── package-info.java │ │ └── signal │ │ │ ├── SignalOutputStream.java │ │ │ ├── package-info.java │ │ │ └── transform │ │ │ ├── CooleyTukeyFastFourierTransformer.java │ │ │ ├── DiscreteFourierTransform.java │ │ │ ├── FastFourierTransformer.java │ │ │ ├── FastFourierTransformerInputStream.java │ │ │ ├── Transforms.java │ │ │ └── package-info.java │ │ ├── genetics │ │ ├── AbstractGeneticAlgorithmFitnessFunction.java │ │ ├── AbstractGeneticAlgorithmPopulation.java │ │ ├── AbstractValueGene.java │ │ ├── ByteValueGene.java │ │ ├── Chromatid.java │ │ ├── DoubleValueGene.java │ │ ├── FloatValueGene.java │ │ ├── Gene.java │ │ ├── GeneticAlgorithmChromosome.java │ │ ├── IntegerValueGene.java │ │ ├── LongValueGene.java │ │ ├── MutableByte.java │ │ ├── MutableDouble.java │ │ ├── MutableFloat.java │ │ ├── MutableInteger.java │ │ ├── MutableLong.java │ │ ├── MutableNumber.java │ │ ├── MutableShort.java │ │ ├── ShortValueGene.java │ │ ├── ValueGene.java │ │ ├── package-info.java │ │ └── wavelets │ │ │ ├── AbstractKey.java │ │ │ ├── AbstractOrganism.java │ │ │ ├── AbstractWaveletGene.java │ │ │ ├── Cell.java │ │ │ ├── Chromosome.java │ │ │ ├── Environment.java │ │ │ ├── ExpressionFunction.java │ │ │ ├── ExternalSignalGene.java │ │ │ ├── Mutations.java │ │ │ ├── Nucleus.java │ │ │ ├── PromoterGene.java │ │ │ ├── ReceptorKey.java │ │ │ ├── SignalGene.java │ │ │ ├── SignalKey.java │ │ │ ├── SignalKeyConcentration.java │ │ │ ├── SignalProcessingWavelet.java │ │ │ ├── WaveletChromatid.java │ │ │ └── package-info.java │ │ ├── graph │ │ ├── AbstractAdjacencyGraph.java │ │ ├── AbstractBidirectedAdjacencyGraph.java │ │ ├── AbstractBidirectedEdge.java │ │ ├── AbstractCycle.java │ │ ├── AbstractDirectedAdjacencyGraph.java │ │ ├── AbstractDirectedEdge.java │ │ ├── AbstractHyperAdjacencyGraph.java │ │ ├── AbstractHyperedge.java │ │ ├── AbstractPath.java │ │ ├── AbstractRootedTreeAdjacencyGraph.java │ │ ├── AbstractTraversableCloud.java │ │ ├── AbstractTreeAdjacencyGraph.java │ │ ├── AbstractUndirectedEdge.java │ │ ├── AbstractUniqueBidirectedEdge.java │ │ ├── AbstractUniqueCloud.java │ │ ├── AbstractWalk.java │ │ ├── AbstractWeightedBidirectedEdge.java │ │ ├── AbstractWeightedCloud.java │ │ ├── BidirectedEdge.java │ │ ├── BidirectedGraph.java │ │ ├── Cloud.java │ │ ├── Cycle.java │ │ ├── DirectedEdge.java │ │ ├── DirectedGraph.java │ │ ├── Graph.java │ │ ├── HyperGraph.java │ │ ├── Hyperedge.java │ │ ├── ImmutableAdjacencyGraph.java │ │ ├── ImmutableDirectedAdjacencyGraph.java │ │ ├── ImmutableDirectedEdge.java │ │ ├── ImmutableHyperAdjacencyGraph.java │ │ ├── ImmutableHyperedge.java │ │ ├── ImmutableRootedTreeAdjacencyGraph.java │ │ ├── ImmutableTreeAdjacencyGraph.java │ │ ├── ImmutableUndirectedEdge.java │ │ ├── ImmutableWeightedDirectedEdge.java │ │ ├── ImmutableWeightedHyperedge.java │ │ ├── ImmutableWeightedUndirectedEdge.java │ │ ├── MutableAdjacencyGraph.java │ │ ├── MutableBidirectedGraph.java │ │ ├── MutableDirectedAdjacencyGraph.java │ │ ├── MutableDirectedGraph.java │ │ ├── MutableGraph.java │ │ ├── MutableHyperAdjacencyGraph.java │ │ ├── MutableHyperGraph.java │ │ ├── MutableRootedTreeAdjacencyGraph.java │ │ ├── MutableRootedTreeGraph.java │ │ ├── MutableTreeAdjacencyGraph.java │ │ ├── MutableTreeGraph.java │ │ ├── MutableWeighted.java │ │ ├── Path.java │ │ ├── RootedTreeGraph.java │ │ ├── SimpleCycle.java │ │ ├── SimplePath.java │ │ ├── SimpleWalk.java │ │ ├── SimpleWeightedDirectedEdge.java │ │ ├── SimpleWeightedHyperedge.java │ │ ├── SimpleWeightedUndirectedEdge.java │ │ ├── TraversableCloud.java │ │ ├── TreeGraph.java │ │ ├── UndirectedEdge.java │ │ ├── Walk.java │ │ ├── Weighted.java │ │ ├── WeightedBidirectedEdge.java │ │ ├── WeightedCloud.java │ │ ├── WeightedDirectedEdge.java │ │ ├── WeightedHyperedge.java │ │ ├── context │ │ │ ├── AbstractContextGraphElement.java │ │ │ ├── AbstractContextNode.java │ │ │ ├── AbstractSignalContextNode.java │ │ │ ├── AbstractSignalingContextCloud.java │ │ │ ├── ContextEdge.java │ │ │ ├── ContextGraphElement.java │ │ │ ├── ContextNode.java │ │ │ ├── ContextReporter.java │ │ │ ├── SignalContextNode.java │ │ │ └── SignalingContextCloud.java │ │ ├── cycle │ │ │ ├── ColoredDepthFirstSearchDetector.java │ │ │ ├── CycleDetector.java │ │ │ ├── CycleFinder.java │ │ │ ├── CycleOptimizedGraph.java │ │ │ ├── Cycles.java │ │ │ └── ExhaustiveDepthFirstSearchCycleFinder.java │ │ ├── drawing │ │ │ ├── GraphDrawer.java │ │ │ └── hyperassociativemap │ │ │ │ ├── BrainHyperassociativeMap.java │ │ │ │ ├── HyperassociativeMap.java │ │ │ │ ├── LayeredBrainHyperassociativeMap.java │ │ │ │ ├── NeighborNotFoundException.java │ │ │ │ └── visualization │ │ │ │ ├── HyperassociativeMapCanvas.java │ │ │ │ └── HyperassociativeMapVisualization.java │ │ ├── search │ │ │ ├── LocalSearch.java │ │ │ ├── optimization │ │ │ │ └── HillClimbingLocalSearch.java │ │ │ └── pathfinding │ │ │ │ ├── AstarPathFinder.java │ │ │ │ ├── BellmanFordPathFinder.java │ │ │ │ ├── DijkstraPathFinder.java │ │ │ │ ├── FloydWarshallPathFinder.java │ │ │ │ ├── GraphTransformer.java │ │ │ │ ├── HeuristicPathCost.java │ │ │ │ ├── JohnsonGraphTransformer.java │ │ │ │ ├── JohnsonPathFinder.java │ │ │ │ ├── NegativeWeightCycleException.java │ │ │ │ └── PathFinder.java │ │ ├── topological │ │ │ ├── ConnectionismOptimizedBidirectedGraph.java │ │ │ ├── ConnectionismOptimizedGraph.java │ │ │ ├── ConnectionismOptimizedHyperGraph.java │ │ │ ├── KnotOptimizedGraph.java │ │ │ ├── StrongConnectivityOptimizedGraph.java │ │ │ ├── StructureOptimizedGraph.java │ │ │ ├── StructureOptimizedHyperGraph.java │ │ │ ├── Topography.java │ │ │ ├── WeakConnectivityOptimizedGraph.java │ │ │ └── sorter │ │ │ │ ├── SimpleTopologicalRanker.java │ │ │ │ ├── TopologicalRanker.java │ │ │ │ └── TopologicalSorter.java │ │ └── tree │ │ │ ├── TreeOptimizedBidirectedGraph.java │ │ │ ├── TreeOptimizedDirectedGraph.java │ │ │ ├── TreeOptimizedGraph.java │ │ │ ├── Trees.java │ │ │ └── mst │ │ │ ├── KruskalMinimumSpanningTreeFinder.java │ │ │ ├── MinimumSpanningTreeFinder.java │ │ │ ├── PrimMinimumSpanningTreeFinder.java │ │ │ └── RootedMinimumSpanningTreeFinder.java │ │ ├── graphicalmodel │ │ ├── AbstractGraphicalModelAdjacencyGraph.java │ │ ├── EvidenceMap.java │ │ ├── GraphicalModel.java │ │ ├── GraphicalModelNode.java │ │ ├── ImmutableGraphicalModelAdjacencyGraph.java │ │ ├── MutableGraphicalModel.java │ │ ├── MutableGraphicalModelAdjacencyGraph.java │ │ ├── SimpleGraphicalModelNode.java │ │ ├── StateEvidence.java │ │ ├── bayesian │ │ │ ├── AbstractBayesianAdjacencyNetwork.java │ │ │ ├── BayesianNetwork.java │ │ │ ├── ImmutableBayesianAdjacencyNetwork.java │ │ │ ├── MutableBayesianAdjacencyNetwork.java │ │ │ └── MutableBayesianNetwork.java │ │ ├── dynamic │ │ │ ├── AbstractDynamicGraphicalModel.java │ │ │ ├── DynamicGraphicalModel.java │ │ │ ├── DynamicGraphicalModelNode.java │ │ │ ├── HiddenMarkovDynamicGraphicalModelNode.java │ │ │ ├── ImmutableDynamicGraphicalModel.java │ │ │ ├── MutableDynamicGraphicalModel.java │ │ │ ├── MutableDynamicGraphicalModelAdjacencyGraph.java │ │ │ └── SimpleDynamicGraphicalModelNode.java │ │ └── markovrandomfield │ │ │ ├── AbstractMarkovRandomFieldAdjacencyGraph.java │ │ │ ├── ImmutableMarkovRandomFieldAdjacencyGraph.java │ │ │ ├── MarkovRandomField.java │ │ │ ├── MutableMarkovRandomField.java │ │ │ └── MutableMarkovRandomFieldAdjacencyGraph.java │ │ ├── math │ │ ├── AbstractFunction.java │ │ ├── Algebraic.java │ │ ├── Averages.java │ │ ├── ComplexNumber.java │ │ ├── Field.java │ │ ├── FieldElement.java │ │ ├── Function.java │ │ ├── GreatestCommonDenominators.java │ │ ├── OrderedAlgebraic.java │ │ ├── OrderedField.java │ │ ├── OrderedFieldElement.java │ │ ├── OrderedTrigonometricAlgebraic.java │ │ ├── RealNumber.java │ │ ├── Trigonometric.java │ │ ├── TrigonometricAlgebraic.java │ │ ├── Vector.java │ │ ├── counting │ │ │ ├── AbstractPermutationCounter.java │ │ │ ├── CombinationCounter.java │ │ │ ├── Counter.java │ │ │ ├── Counters.java │ │ │ ├── JohnsonTrotterPermutationCounter.java │ │ │ ├── LexicographicPermutationCounter.java │ │ │ └── PermutationCounter.java │ │ ├── linear │ │ │ ├── Matrix.java │ │ │ ├── OrderedMatrix.java │ │ │ ├── RealMatrix.java │ │ │ ├── SimpleRealMatrix.java │ │ │ └── decomposition │ │ │ │ ├── CholeskyBanachiewiczCholeskyDecomposition.java │ │ │ │ ├── CholeskyCroutCholeskyDecomposition.java │ │ │ │ ├── CholeskyDecomposition.java │ │ │ │ ├── Decomposition.java │ │ │ │ ├── Decompositions.java │ │ │ │ ├── DoolittleLuDecomposition.java │ │ │ │ ├── EigenvalueDecomposition.java │ │ │ │ ├── HessenbergDecomposition.java │ │ │ │ ├── HouseholderQrDecomposition.java │ │ │ │ ├── LuDecomposition.java │ │ │ │ ├── NonsymetricHessenbergReduction.java │ │ │ │ ├── QrDecomposition.java │ │ │ │ ├── SchurEigenvalueDecomposition.java │ │ │ │ ├── SingularValueDecomposition.java │ │ │ │ ├── SolvableDecomposition.java │ │ │ │ ├── StewartSingularValueDecomposition.java │ │ │ │ └── TridiagonalEignevalueDecomposition.java │ │ ├── statistics │ │ │ ├── AbstractMarkovChain.java │ │ │ ├── MarkovChain.java │ │ │ ├── MarkovChainEvidence.java │ │ │ ├── SimpleMarkovChain.java │ │ │ └── SimpleMarkovChainEvidence.java │ │ └── wave │ │ │ ├── SharpenedWaveFunction.java │ │ │ ├── WaveFunction.java │ │ │ ├── WaveMultidimensionalFunction.java │ │ │ └── wavelet │ │ │ ├── CombinedWaveletFunction.java │ │ │ └── SharpenedWaveletFunction.java │ │ ├── neural │ │ ├── AbstractActivationNeuron.java │ │ ├── AbstractInputNeuron.java │ │ ├── AbstractLocalBrain.java │ │ ├── AbstractNeuron.java │ │ ├── AbstractOutputNeuron.java │ │ ├── AbstractStaticNeuron.java │ │ ├── AbstractSynapse.java │ │ ├── Brain.java │ │ ├── InputNeuron.java │ │ ├── InvalidConnectionTypeDannException.java │ │ ├── Neuron.java │ │ ├── NeuronGroup.java │ │ ├── OutputNeuron.java │ │ ├── SimpleSynapse.java │ │ ├── StaticNeuron.java │ │ ├── Synapse.java │ │ ├── SynapseDoesNotExistDannException.java │ │ ├── SynapseNotConnectedDannException.java │ │ ├── activation │ │ │ ├── ActivationFunction.java │ │ │ ├── GausianActivationFunction.java │ │ │ ├── HyperbolicSecantActivationFunction.java │ │ │ ├── HyperbolicTangentActivationFunction.java │ │ │ ├── IdentityActivationFunction.java │ │ │ ├── SineActivationFunction.java │ │ │ └── SqrtActivationFunction.java │ │ ├── backprop │ │ │ ├── AbstractBackpropNeuron.java │ │ │ ├── AbstractBackpropStaticNeuron.java │ │ │ ├── AbstractInputBackpropNeuron.java │ │ │ ├── AbstractOutputBackpropNeuron.java │ │ │ ├── BackpropNeuron.java │ │ │ ├── BackpropStaticNeuron.java │ │ │ ├── InputBackpropNeuron.java │ │ │ ├── OutputBackpropNeuron.java │ │ │ ├── SimpleBackpropNeuron.java │ │ │ ├── SimpleInputBackpropNeuron.java │ │ │ ├── SimpleOutputBackpropNeuron.java │ │ │ └── brain │ │ │ │ ├── AbstractFeedforwardBrain.java │ │ │ │ ├── AbstractFullyConnectedFeedforwardBrain.java │ │ │ │ ├── BackpropBrain.java │ │ │ │ ├── FeedforwardBackpropBrain.java │ │ │ │ └── FullyConnectedFeedforwardBrain.java │ │ ├── realtime │ │ │ └── RealtimeBrain.java │ │ └── som │ │ │ ├── AbstractSomInputNeuron.java │ │ │ ├── SimpleSomInputNeuron.java │ │ │ ├── SimpleSomNeuron.java │ │ │ ├── SomInputNeuron.java │ │ │ ├── SomNeuron.java │ │ │ ├── SomOutputNeuron.java │ │ │ └── brain │ │ │ ├── AbstractExponentialDecaySomBrain.java │ │ │ ├── AbstractSomBrain.java │ │ │ ├── ExponentialDecaySomBrain.java │ │ │ └── SomBrain.java │ │ ├── package-info.java │ │ └── xml │ │ ├── Namer.java │ │ ├── XmlSerializable.java │ │ └── XmlSerializableAdapter.java └── resources │ ├── com.syncleus.dann.graph.xml.xsd │ ├── com.syncleus.dann.graphicalmodel.bayesian.xml.xsd │ ├── com.syncleus.dann.graphicalmodel.xml.xsd │ ├── com.syncleus.dann.xml.xsd │ └── log4j.properties └── test ├── config ├── checkstyle.xml └── pmd.xml └── java └── com └── syncleus └── dann ├── InteractiveTests.java ├── PackageUtility.java ├── classify └── naive │ ├── TestSimpleLanguageClassifier.java │ ├── TestStemmingLanguageClassifier.java │ └── bayes │ ├── TestSimpleLanguageNaiveBayesClassifier.java │ ├── TestStemmingLanguageNaiveBayesClassifier.java │ └── fisher │ ├── TestSimpleLanguageFisherClassifier.java │ └── TestStemmingLanguageFisherClassifier.java ├── dataprocessing ├── language │ └── parsing │ │ └── stem │ │ └── TestPorterStemmer.java └── signal │ └── transform │ ├── TestCooleyTukeyFastFourierTransformer.java │ └── TestDiscreteFourierTransform.java ├── genetics ├── TestByteValueGene.java ├── TestDoubleValueGene.java ├── TestFloatValueGene.java ├── TestGeneticCube.java ├── TestIntegerValueGene.java ├── TestLongValueGene.java ├── TestMutableByte.java ├── TestMutableDouble.java ├── TestMutableFloat.java ├── TestMutableInteger.java ├── TestMutableLong.java ├── TestMutableShort.java ├── TestShortValueGene.java └── wavelets │ ├── TestKeys.java │ └── TestSignalProcessingWavelet.java ├── graph ├── cycle │ ├── TestColoredDepthFirstSearchDetector.java │ └── TestExhaustiveDepthFirstSearchFinder.java ├── drawing │ └── hyperassociativemap │ │ ├── LayeredHyperassociativeMap.java │ │ ├── SimpleNode.java │ │ ├── SimpleUndirectedGraph.java │ │ ├── TestHyperassociativeMap.java │ │ ├── TestLayeredLoopMap.java │ │ └── TestNeighborNotFoundException.java ├── search │ ├── DirectedGrid.java │ ├── Grid.java │ ├── GridNode.java │ ├── WeightedDirectedGrid.java │ ├── optimization │ │ └── TestHillClimbingLocalSearch.java │ └── pathfinding │ │ ├── TestAstarPathFinder.java │ │ ├── TestBellmanFordPathFinder.java │ │ ├── TestDijkstraPathFinder.java │ │ ├── TestFloydWarshallPathFinder.java │ │ └── TestJohnsonPathFinder.java ├── topological │ └── sorter │ │ └── TestSimpleTopologialSort.java └── tree │ └── mst │ ├── LinkedGraph.java │ ├── TestKruskalMinimumSpanningTreeFinder.java │ └── TestPrimMinimumSpanningTreeFinder.java ├── graphicalmodel ├── TestEvidenceMap.java ├── TestStateEvidence.java ├── bayesian │ ├── TestSicknessBayesianNetwork.java │ ├── TestSimpleBayesianNetwork.java │ ├── TestSimpleBayesianNode.java │ └── TestSimpleBooleanNetwork.java └── markovrandomfield │ ├── TestSicknessRandomMarkovField.java │ ├── TestSimpleBooleanField.java │ ├── TestSimpleMarkovRandomField.java │ └── TestSimpleMarkovRandomFieldNode.java ├── math ├── TestComplexNumber.java ├── TestGreatestCommonDenominators.java ├── TestHyperpoint.java ├── counting │ ├── TestCombinationCounter.java │ ├── TestCounters.java │ ├── TestJohnsonTrotterPermutationCounter.java │ ├── TestLexicographicPermutationCounter.java │ └── TestPermutationCounter.java ├── linear │ └── TestMagicSquare.java └── statistics │ ├── TestSimpleMarkovChain.java │ └── TestSimpleMarkovChainEvidence.java └── neural ├── TestDannException.java ├── TestInvalidConnectionTypeDannException.java ├── TestNeuronGroup.java ├── TestSynapse.java ├── TestSynapseDoesNotExistException.java ├── TestSynapseNotConnectedException.java ├── activation ├── TestActivationBounds.java └── TestActivationValues.java ├── backprop └── TestXor.java └── som └── TestColor.java /doc/Neuron.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncleus/dANN-core/2cbf8ff830a9dc5ef7345a241f045c3d138163d1/doc/Neuron.gif -------------------------------------------------------------------------------- /doc/Neuron.vsd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syncleus/dANN-core/2cbf8ff830a9dc5ef7345a241f045c3d138163d1/doc/Neuron.vsd -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/attributes/Attribute.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.attributes; 20 | 21 | public interface Attribute 22 | { 23 | A getAttribute(); 24 | Class getAttributeValueType(); 25 | boolean isAttributeValue(Object attributeValue); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/attributes/AttributeChangeListener.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.attributes; 20 | 21 | public interface AttributeChangeListener 22 | { 23 | void attributeChanged(Attribute attribute, V attributeValue); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/attributes/AttributePool.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.attributes; 20 | 21 | public interface AttributePool 22 | { 23 | boolean listen(AttributeChangeListener listener, Attribute attribute); 24 | boolean listenAll(AttributeChangeListener listener); 25 | boolean removeListener(AttributeChangeListener listener); 26 | boolean removeListener(AttributeChangeListener listener, Attribute attribute); 27 | C getAttributeValue(Attribute attribute); 28 | C setAttributeValue(Attribute attribute, C value); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/attributes/IntegerAttribute.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.attributes; 20 | 21 | public class IntegerAttribute extends SimpleAttribute 22 | { 23 | public IntegerAttribute(final Integer attributeId, final Class attributeValueType) 24 | { 25 | super(attributeId, attributeValueType); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/attributes/StringAttribute.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.attributes; 20 | 21 | public class StringAttribute extends SimpleAttribute 22 | { 23 | public StringAttribute(final String attributeId, final Class attributeValueType) 24 | { 25 | super(attributeId, attributeValueType); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/attributes/hat/HierarchicalAttributePool.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.attributes.hat; 20 | 21 | import com.syncleus.dann.attributes.AttributePool; 22 | 23 | public interface HierarchicalAttributePool extends AttributePool 24 | { 25 | HierarchicalAttributePool getParent(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/attributes/hat/HierarchicalAttributeTreeGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.attributes.hat; 20 | 21 | import com.syncleus.dann.graph.DirectedEdge; 22 | import com.syncleus.dann.graph.TreeGraph; 23 | 24 | public interface HierarchicalAttributeTreeGraph, E extends DirectedEdge, T> extends TreeGraph 25 | { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/attributes/hat/MutableHierarchicalAttributeTreeGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.attributes.hat; 20 | 21 | import com.syncleus.dann.graph.DirectedEdge; 22 | import com.syncleus.dann.graph.MutableTreeGraph; 23 | 24 | public interface MutableHierarchicalAttributeTreeGraph, E extends DirectedEdge, T> extends HierarchicalAttributeTreeGraph, MutableTreeGraph 25 | { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/attributes/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * Hierarchical Attribute Tree Package. 22 | */ 23 | package com.syncleus.dann.attributes; 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/LanguageClassifier.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify; 20 | 21 | import java.util.Locale; 22 | 23 | /** 24 | * A LanguageClassifier is a Classifier that classifies words into categories. 25 | * @param The categories to classify words into. 26 | * @author Jeffrey Phillips Freeman 27 | */ 28 | public interface LanguageClassifier extends Classifier 29 | { 30 | /** 31 | * Gets the locale used by the LanguageClassifier. 32 | * @return The locale in use 33 | */ 34 | Locale getLocale(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/Trainable.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify; 20 | 21 | /** 22 | * If a class is Trainable, it means that it learns to put certain items in certain categories. 23 | * @param The type of item to train 24 | * @param The type of category to train 25 | * @author Jeffrey Phillips Freeman 26 | */ 27 | public interface Trainable 28 | { 29 | /** 30 | * Causes the Trainable to associate the item with the given category. 31 | * @param item The item 32 | * @param category The category to associate with the item 33 | */ 34 | void train(I item, C category); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/TrainableClassifier.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify; 20 | 21 | /** 22 | * A TrainableClassifier is any Classifier which is Trainable. 23 | * @param The type of item to use 24 | * @param The type of categories to use 25 | * @author Jeffrey Phillips Freeman 26 | * @see Classifier 27 | * @see Trainable 28 | */ 29 | public interface TrainableClassifier extends Classifier, Trainable 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/TrainableLanguageClassifier.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify; 20 | 21 | /** 22 | * A TrainableLanguageClassifier is a LanguageClassifier that is also Trainable. 23 | * @param The categories to put words into. 24 | * @author Jeffrey Phillips Freeman 25 | * @see LanguageClassifier 26 | * @see Trainable 27 | * @see TrainableClassifier 28 | */ 29 | public interface TrainableLanguageClassifier extends Trainable, LanguageClassifier, TrainableClassifier 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/FeatureExtractor.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify.naive; 20 | 21 | import java.util.Set; 22 | 23 | /** 24 | * Extracts a series of features from a given item. 25 | * @param The type of feature 26 | * @param The type of item 27 | * @author Jeffrey Phillips Freeman 28 | */ 29 | public interface FeatureExtractor 30 | { 31 | /** 32 | * Gets the list of features for a given item. 33 | * @param item The item 34 | * @return The set of features for this item 35 | */ 36 | Set getFeatures(I item); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/LanguageNaiveClassifier.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify.naive; 20 | 21 | import com.syncleus.dann.classify.LanguageClassifier; 22 | 23 | /** 24 | * A LanguageNaiveClassifier is a NaiveClassifier for words. 25 | * @param The categories to put words into 26 | * @author Jeffrey Phillips Freeman 27 | * @see com.syncleus.dann.classify.naive.NaiveClassifier 28 | * @see com.syncleus.dann.classify.LanguageClassifier 29 | */ 30 | public interface LanguageNaiveClassifier extends NaiveClassifier, LanguageClassifier 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/TrainableLanguageNaiveClassifier.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify.naive; 20 | 21 | import com.syncleus.dann.classify.TrainableLanguageClassifier; 22 | 23 | /** 24 | * A TrainableLanguageNaiveClassifier is a TrainableNaiveClassifier that's also a LanguageNaiveClassifier and a TrainableLanguageClassifier. 25 | * @param The classification 26 | * @author Jeffrey Phillips Freeman 27 | */ 28 | public interface TrainableLanguageNaiveClassifier extends TrainableNaiveClassifier, LanguageNaiveClassifier, TrainableLanguageClassifier 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/TrainableNaiveClassifier.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify.naive; 20 | 21 | import com.syncleus.dann.classify.TrainableClassifier; 22 | 23 | /** 24 | * A TrainableNaiveClassifier is a NaiveClassifier that's also a TrainableClassifier. 25 | * @param The item to classify 26 | * @param The features of the item 27 | * @param The categories of the item 28 | * @author Jeffrey Phillips Freeman 29 | */ 30 | public interface TrainableNaiveClassifier extends NaiveClassifier, TrainableClassifier 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/bayes/LanguageNaiveBayesClassifier.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify.naive.bayes; 20 | 21 | import com.syncleus.dann.classify.LanguageClassifier; 22 | 23 | /** 24 | * Classifies words based on 25 | * 26 | * Bayes' Theorem with a strong independence assumption. 27 | * @param The categories to place words in 28 | * @author Jeffrey Phillips Freeman 29 | */ 30 | public interface LanguageNaiveBayesClassifier extends NaiveBayesClassifier, LanguageClassifier 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/bayes/TrainableNaiveBayesClassifier.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify.naive.bayes; 20 | 21 | import com.syncleus.dann.classify.naive.TrainableNaiveClassifier; 22 | 23 | /** 24 | * A TrainableNaiveBayesClassifier is a trainable, naive classifier based on 25 | * Bayes' Theorem. 26 | * @param The type of item 27 | * @param The type of feature 28 | * @param The type of category 29 | * @author Jeffrey Phillips Freeman 30 | */ 31 | public interface TrainableNaiveBayesClassifier extends NaiveBayesClassifier, TrainableNaiveClassifier 32 | { 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/bayes/fisher/LanguageFisherClassifier.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.classify.naive.bayes.fisher; 20 | 21 | import com.syncleus.dann.classify.naive.bayes.LanguageNaiveBayesClassifier; 22 | 23 | /** 24 | * A LanguageFisherClassifier is a FisherClassifier for words. 25 | * @param The categories to place words in 26 | * @author Jeffrey Phillips Freeman 27 | */ 28 | public interface LanguageFisherClassifier extends FisherClassifier, LanguageNaiveBayesClassifier 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/bayes/fisher/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * This package contains naive classifiers using Bayes' theorem plus 22 | * 23 | * Fisher's linear discriminant. 24 | */ 25 | package com.syncleus.dann.classify.naive.bayes.fisher; 26 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/bayes/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | 21 | /** 22 | * This package contains naive classifiers using Bayes' theorem. 23 | * See 24 | * Statistical classification - Bayesian procedures. 25 | */ 26 | package com.syncleus.dann.classify.naive.bayes; 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/naive/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * Naive items start with no known items, and are trained from nothing. 22 | */ 23 | package com.syncleus.dann.classify.naive; 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/classify/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * Contains Classifiers, Trainables, and TrainableClassifiers. 22 | */ 23 | package com.syncleus.dann.classify; 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/dataprocessing/language/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * This package contains classes specific to Natural Language Processing. 22 | */ 23 | package com.syncleus.dann.dataprocessing.language; 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/dataprocessing/language/parsing/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * This package contains classes which parse Strings into individual words and 22 | * word parts, for use in language processing. 23 | */ 24 | package com.syncleus.dann.dataprocessing.language.parsing; 25 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/dataprocessing/language/parsing/stem/Stemmer.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.dataprocessing.language.parsing.stem; 20 | 21 | /** 22 | * A Stemmer gets the 23 | * word stem from a word. 24 | * @author Jeffrey Phillips Freeman 25 | */ 26 | public interface Stemmer 27 | { 28 | /** 29 | * Gets the word stem from the given word. 30 | * @param word The word to get the stem from 31 | * @return The stem for the given word 32 | */ 33 | String stemWord(String word); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/dataprocessing/language/parsing/stem/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * Divides words into stems for language processing. 22 | */ 23 | package com.syncleus.dann.dataprocessing.language.parsing.stem; 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/dataprocessing/signal/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * This package contains classes for working with Signals. 22 | */ 23 | package com.syncleus.dann.dataprocessing.signal; 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/dataprocessing/signal/transform/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * This package includes transforms for use in signal processing. 22 | */ 23 | package com.syncleus.dann.dataprocessing.signal.transform; 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/genetics/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * This package provides methods and data types to interface with genetic 22 | * algorithms, the implementations of which are in 23 | * {@link com.syncleus.dann.genetics.wavelets}. 24 | */ 25 | package com.syncleus.dann.genetics; 26 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/genetics/wavelets/AbstractOrganism.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.genetics.wavelets; 20 | 21 | // TODO convert to an interface? 22 | public abstract class AbstractOrganism 23 | { 24 | // private HashSet cells; 25 | 26 | public abstract AbstractOrganism mate(AbstractOrganism partner); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/genetics/wavelets/Environment.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.genetics.wavelets; 20 | 21 | // TODO unused.. remove? 22 | public class Environment 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/genetics/wavelets/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.genetics.wavelets; 20 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/Cloud.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | import com.syncleus.dann.graph.context.ContextReporter; 22 | import com.syncleus.dann.graph.xml.EdgeXml; 23 | import com.syncleus.dann.xml.XmlSerializable; 24 | 25 | import java.io.Serializable; 26 | import java.util.Collection; 27 | import java.util.List; 28 | 29 | public interface Cloud extends Serializable, Cloneable, XmlSerializable, ContextReporter 30 | { 31 | Collection getNodes(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/Cycle.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface Cycle> extends Walk 22 | { 23 | boolean isOddCycle(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/DirectedEdge.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | import java.util.List; 22 | 23 | public interface DirectedEdge extends BidirectedEdge 24 | { 25 | N getSourceNode(); 26 | N getDestinationNode(); 27 | @Override 28 | DirectedEdge disconnect(N node); 29 | @Override 30 | DirectedEdge disconnect(List node); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/DirectedGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | /** 22 | * A type of graph where every edge has exactly 2 end points which always has a 23 | * directionality set to inward on one end and outward ont he other. 24 | * 25 | * @since 2.0 26 | */ 27 | public interface DirectedGraph> extends BidirectedGraph 28 | { 29 | //we need this for the optimizer and utility class operations. We might also want to fill it in later. 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/Hyperedge.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | import java.util.List; 22 | 23 | public interface Hyperedge extends TraversableCloud 24 | { 25 | int getDegree(); 26 | boolean isSymmetric(Hyperedge symmetricEdge); 27 | Hyperedge connect(N node); 28 | Hyperedge connect(List node); 29 | @Override 30 | Hyperedge disconnect(N node); 31 | @Override 32 | Hyperedge disconnect(List node); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/MutableBidirectedGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface MutableBidirectedGraph> extends BidirectedGraph, MutableGraph 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/MutableDirectedGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface MutableDirectedGraph> extends DirectedGraph, MutableBidirectedGraph 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/MutableGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface MutableGraph> extends Graph 22 | { 23 | boolean add(E newEdge); 24 | boolean add(N newNode); 25 | boolean remove(E edgeToRemove); 26 | boolean remove(N nodeToRemove); 27 | boolean clear(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/MutableHyperGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface MutableHyperGraph> extends HyperGraph, MutableGraph 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/MutableRootedTreeGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface MutableRootedTreeGraph> extends RootedTreeGraph, MutableTreeGraph 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/MutableTreeGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface MutableTreeGraph> extends TreeGraph, MutableBidirectedGraph 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/MutableWeighted.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface MutableWeighted extends Weighted 22 | { 23 | void setWeight(double newWeight); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/Path.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface Path> extends Walk 22 | { 23 | N getFirstNode(); 24 | N getLastNode(); 25 | boolean isChain(); 26 | boolean isIndependent(Path path); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/RootedTreeGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface RootedTreeGraph> extends TreeGraph, DirectedGraph 22 | { 23 | N getRoot(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/UndirectedEdge.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | import java.util.List; 22 | 23 | public interface UndirectedEdge extends BidirectedEdge 24 | { 25 | @Override 26 | UndirectedEdge disconnect(N node); 27 | @Override 28 | UndirectedEdge disconnect(List node); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/Walk.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | import java.util.List; 22 | 23 | public interface Walk> 24 | { 25 | List getSteps(); 26 | List getNodeSteps(); 27 | boolean isClosed(); 28 | int getLength(); 29 | boolean isTrail(); 30 | boolean isTour(); 31 | double getWeight(); 32 | boolean hasChildCycles(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/Weighted.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | public interface Weighted 22 | { 23 | double getWeight(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/WeightedBidirectedEdge.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | import java.util.List; 22 | 23 | public interface WeightedBidirectedEdge extends BidirectedEdge, Weighted 24 | { 25 | @Override 26 | WeightedBidirectedEdge disconnect(N node); 27 | @Override 28 | WeightedBidirectedEdge disconnect(List node); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/WeightedCloud.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | import java.util.List; 22 | 23 | public interface WeightedCloud extends TraversableCloud, Weighted 24 | { 25 | @Override 26 | WeightedCloud disconnect(N node); 27 | @Override 28 | WeightedCloud disconnect(List node); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/WeightedDirectedEdge.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | import java.util.List; 22 | 23 | public interface WeightedDirectedEdge extends DirectedEdge, Weighted 24 | { 25 | @Override 26 | WeightedDirectedEdge disconnect(N node); 27 | @Override 28 | WeightedDirectedEdge disconnect(List node); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/WeightedHyperedge.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph; 20 | 21 | import java.util.List; 22 | 23 | public interface WeightedHyperedge extends Hyperedge, Weighted 24 | { 25 | @Override 26 | WeightedHyperedge disconnect(N node); 27 | @Override 28 | WeightedHyperedge disconnect(List node); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/context/ContextEdge.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.context; 20 | 21 | import com.syncleus.dann.graph.TraversableCloud; 22 | import com.syncleus.dann.graph.Graph; 23 | 24 | public interface ContextEdge, G extends Graph> extends TraversableCloud 25 | { 26 | void nodeJoiningGraph(G graph, N node); 27 | void nodeLeavingGraph(G graph, N node); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/context/ContextGraphElement.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.context; 20 | 21 | import java.util.Set; 22 | import com.syncleus.dann.graph.Graph; 23 | 24 | public interface ContextGraphElement> 25 | { 26 | boolean isAllowingMultipleGraphs(); 27 | boolean joiningGraph(G graph); 28 | boolean leavingGraph(G graph); 29 | boolean isGraphMember(); 30 | Set getJoinedGraphs(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/context/ContextNode.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.context; 20 | 21 | import com.syncleus.dann.graph.TraversableCloud; 22 | 23 | public interface ContextNode> 24 | { 25 | boolean connectingEdge(E edge); 26 | boolean disconnectingEdge(E edge); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/context/SignalContextNode.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.context; 20 | 21 | import com.syncleus.dann.graph.TraversableCloud; 22 | 23 | public interface SignalContextNode, S> 24 | { 25 | void neighborNodeStateChanged(E edge, N node, S newState); 26 | S getState(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/context/SignalingContextCloud.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.context; 20 | 21 | import com.syncleus.dann.graph.TraversableCloud; 22 | 23 | public interface SignalingContextCloud extends TraversableCloud 24 | { 25 | void nodeStateChanged(N node, S newState); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/cycle/CycleDetector.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.cycle; 20 | 21 | import com.syncleus.dann.graph.TraversableCloud; 22 | import com.syncleus.dann.graph.Graph; 23 | 24 | public interface CycleDetector 25 | { 26 | > boolean hasCycle(Graph graph); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/cycle/CycleFinder.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.cycle; 20 | 21 | import java.util.Set; 22 | import com.syncleus.dann.graph.Cycle; 23 | import com.syncleus.dann.graph.TraversableCloud; 24 | import com.syncleus.dann.graph.Graph; 25 | 26 | public interface CycleFinder> extends CycleDetector 27 | { 28 | int cycleCount(Graph graph); 29 | Set> findCycles(Graph graph); 30 | boolean isPancyclic(Graph graph); 31 | boolean isUnicyclic(Graph graph); 32 | int girth(Graph graph); 33 | int circumference(Graph graph); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/drawing/GraphDrawer.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.drawing; 20 | 21 | import java.util.Map; 22 | import com.syncleus.dann.graph.Graph; 23 | import com.syncleus.dann.math.Vector; 24 | 25 | // TODO use optimizer approach 26 | 27 | public interface GraphDrawer, N> 28 | { 29 | G getGraph(); 30 | boolean isAlignable(); 31 | boolean isAligned(); 32 | void align(); 33 | int getDimensions(); 34 | Map getCoordinates(); 35 | void reset(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/search/LocalSearch.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.search; 20 | 21 | public interface LocalSearch 22 | { 23 | N search(N startNode); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/search/pathfinding/GraphTransformer.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.search.pathfinding; 20 | 21 | import com.syncleus.dann.graph.Graph; 22 | 23 | public interface GraphTransformer> 24 | { 25 | G transform(G original); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/search/pathfinding/HeuristicPathCost.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.search.pathfinding; 20 | 21 | public interface HeuristicPathCost 22 | { 23 | double getHeuristicPathCost(N begin, N end); 24 | boolean isOptimistic(); 25 | boolean isConsistent(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/search/pathfinding/PathFinder.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.search.pathfinding; 20 | 21 | import java.util.List; 22 | 23 | import com.syncleus.dann.graph.TraversableCloud; 24 | 25 | // TODO implement optimizer approach 26 | 27 | public interface PathFinder> 28 | { 29 | List getBestPath(N begin, N end); 30 | boolean isReachable(N begin, N end); 31 | boolean isConnected(N begin, N end); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/topological/sorter/TopologicalRanker.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.topological.sorter; 20 | 21 | import java.util.List; 22 | import java.util.Set; 23 | import com.syncleus.dann.graph.BidirectedGraph; 24 | import com.syncleus.dann.graph.DirectedEdge; 25 | 26 | public interface TopologicalRanker extends TopologicalSorter 27 | { 28 | List> rank(BidirectedGraph> graph); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/topological/sorter/TopologicalSorter.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.topological.sorter; 20 | 21 | import java.util.List; 22 | import com.syncleus.dann.graph.BidirectedGraph; 23 | import com.syncleus.dann.graph.DirectedEdge; 24 | 25 | // TODO make this follow the optimizer approach 26 | public interface TopologicalSorter 27 | { 28 | List sort(BidirectedGraph> graph); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/tree/TreeOptimizedDirectedGraph.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.tree; 20 | 21 | import com.syncleus.dann.graph.DirectedEdge; 22 | import com.syncleus.dann.graph.DirectedGraph; 23 | 24 | public interface TreeOptimizedDirectedGraph> extends DirectedGraph 25 | { 26 | boolean isRootedTree(); 27 | boolean isRootedForest(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/tree/mst/MinimumSpanningTreeFinder.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.tree.mst; 20 | 21 | import java.util.Set; 22 | import com.syncleus.dann.graph.TraversableCloud; 23 | import com.syncleus.dann.graph.Graph; 24 | 25 | /** 26 | * @param The node type 27 | * @param The type of edge for the given node type 28 | */ 29 | public interface MinimumSpanningTreeFinder> 30 | { 31 | Set findMinimumSpanningTree(Graph graph); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graph/tree/mst/RootedMinimumSpanningTreeFinder.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.tree.mst; 20 | 21 | import java.util.Set; 22 | import com.syncleus.dann.graph.TraversableCloud; 23 | import com.syncleus.dann.graph.Graph; 24 | 25 | public interface RootedMinimumSpanningTreeFinder> extends MinimumSpanningTreeFinder 26 | { 27 | Set findMinimumSpanningTree(Graph graph, N startNode); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/GraphicalModel.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel; 20 | 21 | import java.util.Set; 22 | import com.syncleus.dann.graph.BidirectedEdge; 23 | import com.syncleus.dann.graph.Graph; 24 | 25 | public interface GraphicalModel> extends Graph 26 | { 27 | void learnStates(); 28 | double jointProbability(); 29 | double conditionalProbability(Set goals, Set influences); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/GraphicalModelNode.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel; 20 | 21 | import com.syncleus.dann.graphicalmodel.xml.GraphicalModelNodeXml; 22 | import com.syncleus.dann.xml.XmlSerializable; 23 | import java.util.Set; 24 | 25 | public interface GraphicalModelNode extends XmlSerializable 26 | { 27 | Set getLearnedStates(); 28 | void setState(S currentState); 29 | S getState(); 30 | void learnState(); 31 | double stateProbability(); 32 | double stateProbability(Set ignoredInfluences); 33 | void reset(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/MutableGraphicalModel.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel; 20 | 21 | import com.syncleus.dann.graph.BidirectedEdge; 22 | import com.syncleus.dann.graph.MutableGraph; 23 | 24 | public interface MutableGraphicalModel> extends GraphicalModel, MutableGraph 25 | { 26 | } -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/bayesian/BayesianNetwork.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel.bayesian; 20 | 21 | import com.syncleus.dann.graph.DirectedEdge; 22 | import com.syncleus.dann.graphicalmodel.GraphicalModel; 23 | import com.syncleus.dann.graphicalmodel.GraphicalModelNode; 24 | 25 | public interface BayesianNetwork> extends GraphicalModel 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/bayesian/MutableBayesianNetwork.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel.bayesian; 20 | 21 | import com.syncleus.dann.graph.DirectedEdge; 22 | import com.syncleus.dann.graph.MutableGraph; 23 | import com.syncleus.dann.graphicalmodel.GraphicalModelNode; 24 | 25 | public interface MutableBayesianNetwork> extends BayesianNetwork, MutableGraph 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/dynamic/DynamicGraphicalModel.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel.dynamic; 20 | 21 | import com.syncleus.dann.graph.BidirectedEdge; 22 | import com.syncleus.dann.graphicalmodel.GraphicalModel; 23 | 24 | public interface DynamicGraphicalModel> extends GraphicalModel 25 | { 26 | void learnStates(boolean updateHistory); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/dynamic/DynamicGraphicalModelNode.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel.dynamic; 20 | 21 | import java.util.List; 22 | import com.syncleus.dann.graphicalmodel.GraphicalModelNode; 23 | 24 | public interface DynamicGraphicalModelNode extends GraphicalModelNode 25 | { 26 | int getStateHistoryCapacity(); 27 | List getStateHistory(); 28 | void setStateHistory(List history); 29 | void learnState(boolean updateHistory); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/dynamic/HiddenMarkovDynamicGraphicalModelNode.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel.dynamic; 20 | 21 | import java.util.Collections; 22 | 23 | public class HiddenMarkovDynamicGraphicalModelNode extends SimpleDynamicGraphicalModelNode 24 | { 25 | public HiddenMarkovDynamicGraphicalModelNode(final S initialState) 26 | { 27 | super(0, initialState); 28 | } 29 | 30 | public HiddenMarkovDynamicGraphicalModelNode(final S lastState, final S initialState) 31 | { 32 | super(Collections.singletonList(lastState), initialState); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/dynamic/MutableDynamicGraphicalModel.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel.dynamic; 20 | 21 | import com.syncleus.dann.graph.BidirectedEdge; 22 | import com.syncleus.dann.graph.MutableGraph; 23 | 24 | public interface MutableDynamicGraphicalModel> extends DynamicGraphicalModel, MutableGraph 25 | { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/markovrandomfield/MarkovRandomField.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel.markovrandomfield; 20 | 21 | import com.syncleus.dann.graph.UndirectedEdge; 22 | import com.syncleus.dann.graphicalmodel.GraphicalModel; 23 | import com.syncleus.dann.graphicalmodel.GraphicalModelNode; 24 | 25 | public interface MarkovRandomField> extends GraphicalModel 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/graphicalmodel/markovrandomfield/MutableMarkovRandomField.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graphicalmodel.markovrandomfield; 20 | 21 | import com.syncleus.dann.graph.UndirectedEdge; 22 | import com.syncleus.dann.graph.MutableGraph; 23 | import com.syncleus.dann.graphicalmodel.GraphicalModelNode; 24 | 25 | public interface MutableMarkovRandomField> extends MarkovRandomField, MutableGraph 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/Field.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math; 20 | 21 | public interface Field> 22 | { 23 | F getZero(); 24 | F getOne(); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/FieldElement.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math; 20 | 21 | public interface FieldElement> 22 | { 23 | Field getField(); 24 | F add(F value); 25 | F subtract(F value); 26 | F multiply(F value); 27 | F divide(F value); 28 | F negate(); 29 | F reciprocal(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/Function.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math; 20 | 21 | public interface Function 22 | { 23 | void setParameter(final int parameterIndex, final double value); 24 | void setParameter(final String parameterName, final double value); 25 | double getParameter(final int parameterIndex); 26 | double getParameter(final String parameterName); 27 | String getParameterName(final int parameterIndex); 28 | int getParameterNameIndex(final String parameterName); 29 | int getParameterCount(); 30 | double calculate(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/OrderedAlgebraic.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math; 20 | 21 | public interface OrderedAlgebraic> extends Algebraic, OrderedFieldElement 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/OrderedField.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math; 20 | 21 | public interface OrderedField> extends Field 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/OrderedTrigonometricAlgebraic.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math; 20 | 21 | public interface OrderedTrigonometricAlgebraic> extends TrigonometricAlgebraic, OrderedAlgebraic 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/TrigonometricAlgebraic.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math; 20 | 21 | public interface TrigonometricAlgebraic> extends Trigonometric, Algebraic 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/counting/Counter.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math.counting; 20 | 21 | import java.math.BigInteger; 22 | 23 | public interface Counter 24 | { 25 | void reset(); 26 | BigInteger getRemaining(); 27 | boolean hasMore(); 28 | BigInteger getTotal(); 29 | int[] getNext(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/linear/OrderedMatrix.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math.linear; 20 | 21 | import com.syncleus.dann.math.OrderedFieldElement; 22 | 23 | public interface OrderedMatrix, F extends OrderedFieldElement> extends Matrix 24 | { 25 | F norm1(); 26 | F norm2(); 27 | F normInfinite(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/linear/decomposition/Decomposition.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math.linear.decomposition; 20 | 21 | import com.syncleus.dann.math.FieldElement; 22 | import com.syncleus.dann.math.linear.Matrix; 23 | 24 | public interface Decomposition>> 25 | { 26 | M getMatrix(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/linear/decomposition/EigenvalueDecomposition.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math.linear.decomposition; 20 | 21 | import java.util.List; 22 | import com.syncleus.dann.math.RealNumber; 23 | import com.syncleus.dann.math.linear.RealMatrix; 24 | 25 | public interface EigenvalueDecomposition extends Decomposition 26 | { 27 | RealMatrix getBlockDiagonalMatrix(); 28 | List getImaginaryEigenvalues(); 29 | List getRealEigenvalues(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/linear/decomposition/HessenbergDecomposition.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math.linear.decomposition; 20 | 21 | import com.syncleus.dann.math.linear.RealMatrix; 22 | 23 | public interface HessenbergDecomposition extends Decomposition 24 | { 25 | RealMatrix getHessenbergMatrix(); 26 | @Override 27 | RealMatrix getMatrix(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/linear/decomposition/SolvableDecomposition.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math.linear.decomposition; 20 | 21 | import com.syncleus.dann.math.FieldElement; 22 | import com.syncleus.dann.math.linear.Matrix; 23 | 24 | public interface SolvableDecomposition>> extends Decomposition 25 | { 26 | M solve(M solutionMatrix); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/math/statistics/MarkovChainEvidence.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.math.statistics; 20 | 21 | import java.util.Set; 22 | 23 | public interface MarkovChainEvidence 24 | { 25 | void newChain(); 26 | void learnStep(S state); 27 | Set getObservedStates(); 28 | int getOrder(); 29 | MarkovChain getMarkovChain(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/Neuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural; 20 | 21 | import java.io.Serializable; 22 | 23 | /** 24 | * Interface representing the general methods common to all types of neurons. 25 | * All neurons will connect to other neurons as well as be able to disconnect. 26 | * 27 | * @author Jeffrey Phillips Freeman 28 | * @since 1.0 29 | */ 30 | public interface Neuron extends Serializable 31 | { 32 | /** 33 | * Indicates the neuron has an opportunity to perform any processing of its 34 | * IO. 35 | * 36 | * @since 2.0 37 | */ 38 | void tick(); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/OutputNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural; 20 | 21 | /** 22 | * A Neuron which allows you to retrieve its output. These neurons allow you to 23 | * output data from the brain after processing. 24 | * 25 | * @author Jeffrey Phillips Freeman 26 | * @since 1.0 27 | */ 28 | public interface OutputNeuron extends Neuron 29 | { 30 | /** 31 | * Obtains the current output for this neuron. 32 | * 33 | * @return The current output of the neuron. 34 | * @since 1.0 35 | */ 36 | double getOutput(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/StaticNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural; 20 | 21 | public final class StaticNeuron extends AbstractStaticNeuron 22 | { 23 | private static final long serialVersionUID = 13948812734120L; 24 | 25 | public StaticNeuron(final Brain brain, final double constantOutput) 26 | { 27 | super(brain, constantOutput); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/Synapse.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural; 20 | 21 | import com.syncleus.dann.graph.WeightedDirectedEdge; 22 | 23 | public interface Synapse extends WeightedDirectedEdge 24 | { 25 | double getInput(); 26 | void setInput(double input); 27 | void setWeight(double weight); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/backprop/BackpropNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.backprop; 20 | 21 | import com.syncleus.dann.neural.Neuron; 22 | 23 | public interface BackpropNeuron extends Neuron 24 | { 25 | void backPropagate(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/backprop/BackpropStaticNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.backprop; 20 | 21 | import com.syncleus.dann.neural.Brain; 22 | 23 | public final class BackpropStaticNeuron extends AbstractBackpropStaticNeuron 24 | { 25 | private static final long serialVersionUID = -958292142062664899L; 26 | 27 | public BackpropStaticNeuron(final Brain brain, final double constantOutput) 28 | { 29 | super(brain, constantOutput); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/backprop/InputBackpropNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.backprop; 20 | 21 | import com.syncleus.dann.neural.InputNeuron; 22 | 23 | public interface InputBackpropNeuron extends InputNeuron, BackpropNeuron 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/backprop/OutputBackpropNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.backprop; 20 | 21 | import com.syncleus.dann.neural.OutputNeuron; 22 | 23 | public interface OutputBackpropNeuron extends OutputNeuron, BackpropNeuron 24 | { 25 | void setDesired(final double trainingToSet); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/backprop/SimpleInputBackpropNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.backprop; 20 | 21 | import com.syncleus.dann.neural.Brain; 22 | 23 | /** 24 | * This is a special type of SimpleBackpropNeuron that receives input. 25 | * 26 | * @author Jeffrey Phillips Freeman 27 | * @since 1.0 28 | */ 29 | public final class SimpleInputBackpropNeuron extends AbstractInputBackpropNeuron 30 | { 31 | private static final long serialVersionUID = -183209470174312L; 32 | 33 | public SimpleInputBackpropNeuron(final Brain brain) 34 | { 35 | super(brain); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/realtime/RealtimeBrain.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.realtime; 20 | 21 | // TODO unused. remove? 22 | public interface RealtimeBrain 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/som/AbstractSomInputNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.som; 20 | 21 | import com.syncleus.dann.neural.AbstractInputNeuron; 22 | import com.syncleus.dann.neural.Brain; 23 | 24 | public abstract class AbstractSomInputNeuron extends AbstractInputNeuron implements SomInputNeuron 25 | { 26 | protected AbstractSomInputNeuron(final Brain brain) 27 | { 28 | super(brain); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/som/SimpleSomInputNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.som; 20 | 21 | import com.syncleus.dann.neural.Brain; 22 | 23 | public final class SimpleSomInputNeuron extends AbstractSomInputNeuron 24 | { 25 | public SimpleSomInputNeuron(final Brain brain) 26 | { 27 | super(brain); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/som/SomInputNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.som; 20 | 21 | import com.syncleus.dann.neural.InputNeuron; 22 | 23 | public interface SomInputNeuron extends InputNeuron, SomNeuron 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/som/SomNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.som; 20 | 21 | import com.syncleus.dann.neural.Neuron; 22 | 23 | public interface SomNeuron extends Neuron 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/neural/som/SomOutputNeuron.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.neural.som; 20 | 21 | import com.syncleus.dann.neural.OutputNeuron; 22 | 23 | public interface SomOutputNeuron extends OutputNeuron, SomNeuron 24 | { 25 | void train(double learningRate, double neighborhoodAdjustment); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/package-info.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | 20 | /** 21 | * This package contains the common exceptions for dANN. 22 | */ 23 | package com.syncleus.dann; 24 | -------------------------------------------------------------------------------- /src/main/java/com/syncleus/dann/xml/XmlSerializableAdapter.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.xml; 20 | 21 | import javax.xml.bind.annotation.adapters.XmlAdapter; 22 | 23 | public class XmlSerializableAdapter> extends XmlAdapter 24 | { 25 | @Override 26 | public final X marshal(final V graph) 27 | { 28 | return graph.toXml(); 29 | } 30 | 31 | @Override 32 | public V unmarshal(final X graphXml) 33 | { 34 | throw new IllegalStateException("You can not unmarshal XML through this adapter"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | ### direct log messages to stdout ### 2 | log4j.appender.console=org.apache.log4j.ConsoleAppender 3 | log4j.appender.console.Target=System.out 4 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.console.Threshold=WARN 6 | log4j.appender.log-all=org.apache.log4j.FileAppender 7 | log4j.appender.log-all.File=build/log/log.htm 8 | log4j.appender.log-all.layout=org.apache.log4j.HTMLLayout 9 | log4j.appender.log-info=org.apache.log4j.FileAppender 10 | log4j.appender.log-info.File=build/log/log-info.htm 11 | log4j.appender.log-info.layout=org.apache.log4j.HTMLLayout 12 | log4j.appender.log-info.Threshold=INFO 13 | log4j.appender.log-warn=org.apache.log4j.FileAppender 14 | log4j.appender.log-warn.File=build/log/log-warn.htm 15 | log4j.appender.log-warn.layout=org.apache.log4j.HTMLLayout 16 | log4j.appender.log-warn.Threshold=WARN 17 | log4j.rootLogger=all, console, log-all, log-info, log-warn -------------------------------------------------------------------------------- /src/test/config/pmd.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Standard ruleset. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/test/java/com/syncleus/dann/graph/drawing/hyperassociativemap/LayeredHyperassociativeMap.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.drawing.hyperassociativemap; 20 | 21 | import java.util.concurrent.ThreadPoolExecutor; 22 | 23 | public class LayeredHyperassociativeMap extends HyperassociativeMap 24 | { 25 | private static final int NODES_PER_LAYER = 16; 26 | 27 | LayeredHyperassociativeMap(final int layers, final ThreadPoolExecutor executor) 28 | { 29 | super(new SimpleUndirectedGraph(layers, NODES_PER_LAYER), 3, executor); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/com/syncleus/dann/graph/drawing/hyperassociativemap/SimpleNode.java: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * * 3 | * Copyright: (c) Syncleus, Inc. * 4 | * * 5 | * You may redistribute and modify this source code under the terms and * 6 | * conditions of the Open Source Community License - Type C version 1.0 * 7 | * or any later version as published by Syncleus, Inc. at www.syncleus.com. * 8 | * There should be a copy of the license included with this file. If a copy * 9 | * of the license is not included you are granted no right to distribute or * 10 | * otherwise use this file except through a legal and valid license. You * 11 | * should also contact Syncleus, Inc. at the information below if you cannot * 12 | * find a license: * 13 | * * 14 | * Syncleus, Inc. * 15 | * 2604 South 12th Street * 16 | * Philadelphia, PA 19148 * 17 | * * 18 | ******************************************************************************/ 19 | package com.syncleus.dann.graph.drawing.hyperassociativemap; 20 | 21 | public class SimpleNode 22 | { 23 | final int layer; 24 | 25 | public SimpleNode(final int layer) 26 | { 27 | this.layer = layer; 28 | } 29 | 30 | public int getLayer() 31 | { 32 | return this.layer; 33 | } 34 | } 35 | --------------------------------------------------------------------------------