diff --git a/src/main/java/com/syncleus/grail/graph/AbstractSignalMultiplyingEdge.java b/src/main/java/com/syncleus/grail/graph/AbstractSignalMultiplyingEdge.java index 6d075c555f9daa98d77a76c27b06e1649b395b8f..8e27cf49e4afb00dbfed61ba245e80a93e0637e9 100644 --- a/src/main/java/com/syncleus/grail/graph/AbstractSignalMultiplyingEdge.java +++ b/src/main/java/com/syncleus/grail/graph/AbstractSignalMultiplyingEdge.java @@ -1,16 +1,36 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; -import com.tinkerpop.frames.EdgeFrame; import com.tinkerpop.frames.modules.javahandler.*; import java.util.Random; public abstract class AbstractSignalMultiplyingEdge implements SignalMultiplyingEdge { private static final Random RANDOM = new Random(); + private static final double RANGE = 2.0; + private static final double OFFSET = -1.0; + private static final double SCALE = 1.0 / 10.0; @Initializer public void init() { - this.setWeight(((RANDOM.nextDouble() * 2.0) - 1.0) / 10.0); + this.setWeight(((AbstractSignalMultiplyingEdge.RANDOM.nextDouble() * AbstractSignalMultiplyingEdge.RANGE) + AbstractSignalMultiplyingEdge.OFFSET) * AbstractSignalMultiplyingEdge.SCALE); } @Override diff --git a/src/main/java/com/syncleus/grail/graph/GrailGraphFactory.java b/src/main/java/com/syncleus/grail/graph/GrailGraphFactory.java index 6fd3eadcf6200033cbb6b9d957abfee1d16d1b58..20bcfc74160f1a006ef2732a7e1240c390c5435b 100644 --- a/src/main/java/com/syncleus/grail/graph/GrailGraphFactory.java +++ b/src/main/java/com/syncleus/grail/graph/GrailGraphFactory.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.syncleus.grail.graph.action.*; @@ -52,8 +70,7 @@ public class GrailGraphFactory extends FramedGraphFactory { } private static JavaHandlerModule constructHandlerModule() { - final JavaHandlerModule module = new JavaHandlerModule(); - return module; + return new JavaHandlerModule(); } private static Module[] combineModules(final Collection<? extends Module> modules, Module... additionalModules) { diff --git a/src/main/java/com/syncleus/grail/graph/GrailModule.java b/src/main/java/com/syncleus/grail/graph/GrailModule.java index ad47e6c584aac87b7ad39a3f3474c56f3923355e..68319f7dc90de46312622d50e8a15e93d9af3515 100644 --- a/src/main/java/com/syncleus/grail/graph/GrailModule.java +++ b/src/main/java/com/syncleus/grail/graph/GrailModule.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.blueprints.Graph; @@ -42,7 +60,7 @@ public class GrailModule implements Module { } private static void constructTypedHierarchyRecursive(final Map<String, Set<String>> hierarchy, final Class<?>[] parents, final Set<String> childrenSeen) { - for( Class<?> parent : parents ) { + for( final Class<?> parent : parents ) { final TypeValue typeValue = GrailModule.determineTypeValue(parent); //this parent has a type value, so add all the children to it diff --git a/src/main/java/com/syncleus/grail/graph/Node.java b/src/main/java/com/syncleus/grail/graph/Node.java index 3d79e2cab832ff0ea5d6f05e5167b5db157d4728..6ad2bfcec200e8dc938b46973d7efe0a5d4a1014 100644 --- a/src/main/java/com/syncleus/grail/graph/Node.java +++ b/src/main/java/com/syncleus/grail/graph/Node.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.frames.VertexFrame; diff --git a/src/main/java/com/syncleus/grail/graph/SignalMultiplyingEdge.java b/src/main/java/com/syncleus/grail/graph/SignalMultiplyingEdge.java index f195982fa4ff3ae9118ca0abf27d7b0ed8608f83..ee9d5016ba93550da10b54f38787214074473a13 100644 --- a/src/main/java/com/syncleus/grail/graph/SignalMultiplyingEdge.java +++ b/src/main/java/com/syncleus/grail/graph/SignalMultiplyingEdge.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.frames.*; @@ -13,4 +31,4 @@ public interface SignalMultiplyingEdge extends Weighted, Signaler, EdgeFrame { @JavaHandler void propagate(); -} \ No newline at end of file +} diff --git a/src/main/java/com/syncleus/grail/graph/SignalNode.java b/src/main/java/com/syncleus/grail/graph/SignalNode.java index 328c62ec3fb2174516e139acf0ea7b8a633832f5..6b5ec40a75d634934b71aa4587a74a0510c3e091 100644 --- a/src/main/java/com/syncleus/grail/graph/SignalNode.java +++ b/src/main/java/com/syncleus/grail/graph/SignalNode.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; public interface SignalNode extends Signaler, Node { diff --git a/src/main/java/com/syncleus/grail/graph/Signaler.java b/src/main/java/com/syncleus/grail/graph/Signaler.java index d90455056373025de7f46d93fe19f0af74b9a8eb..0e1328260385be7d3ccf5cecafc13ed50fe63994 100644 --- a/src/main/java/com/syncleus/grail/graph/Signaler.java +++ b/src/main/java/com/syncleus/grail/graph/Signaler.java @@ -1,7 +1,24 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.frames.Property; -import com.tinkerpop.frames.modules.typedgraph.TypeField; public interface Signaler { @Property("signal") diff --git a/src/main/java/com/syncleus/grail/graph/TypedAdjacency.java b/src/main/java/com/syncleus/grail/graph/TypedAdjacency.java index 4af11fb7240d98f0d1fd0133f8f1ea23991869d0..35331bace38a4f76ac2deecbadd17b5c68ed8186 100644 --- a/src/main/java/com/syncleus/grail/graph/TypedAdjacency.java +++ b/src/main/java/com/syncleus/grail/graph/TypedAdjacency.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.blueprints.Direction; diff --git a/src/main/java/com/syncleus/grail/graph/TypedAdjacencyMethodHandler.java b/src/main/java/com/syncleus/grail/graph/TypedAdjacencyMethodHandler.java index f232c1a1cb1c81665a87af27ce8d331000879e14..a2ebf812b9a55add66ae3c864460fe7b43c5e06f 100644 --- a/src/main/java/com/syncleus/grail/graph/TypedAdjacencyMethodHandler.java +++ b/src/main/java/com/syncleus/grail/graph/TypedAdjacencyMethodHandler.java @@ -1,8 +1,25 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.blueprints.*; import com.tinkerpop.frames.*; -import com.tinkerpop.frames.annotations.AdjacencyAnnotationHandler; import com.tinkerpop.frames.modules.MethodHandler; import com.tinkerpop.frames.modules.typedgraph.*; import com.tinkerpop.gremlin.Tokens; @@ -74,7 +91,7 @@ public class TypedAdjacencyMethodHandler implements MethodHandler<TypedAdjacency private Iterable getNodes(final Class type, final Direction direction, final String label, final FramedGraph<?> framedGraph, final Vertex vertex) { final TypeValue typeValue = TypedAdjacencyMethodHandler.determineTypeValue(type); final TypeField typeField = TypedAdjacencyMethodHandler.determineTypeField(type); - Set<String> allAllowedValues = this.hierarchy.get(typeValue.value()); + final Set<String> allAllowedValues = this.hierarchy.get(typeValue.value()); switch(direction) { case BOTH: return framedGraph.frameVertices((Iterable<Vertex>) new GremlinPipeline<Vertex, Vertex>(vertex).both(label).has(typeField.value(), Tokens.T.in, allAllowedValues), type); @@ -141,14 +158,15 @@ public class TypedAdjacencyMethodHandler implements MethodHandler<TypedAdjacency private static TypeField determineTypeField(final Class<?> type) { TypeField typeField = type.getAnnotation(TypeField.class); if( typeField == null ) { - Class<?>[] parents = type.getInterfaces(); + final Class<?>[] parents = type.getInterfaces(); for( final Class<?> parent : parents ) { typeField = TypedAdjacencyMethodHandler.determineTypeFieldRecursive(parent); if( typeField != null ) return typeField; } - if( typeField == null ) - throw new IllegalArgumentException("The specified type does not have a parent with a typeField annotation."); + + //we know typeField must still be null since we didnt return a value yet + throw new IllegalArgumentException("The specified type does not have a parent with a typeField annotation."); } return typeField; @@ -157,7 +175,7 @@ public class TypedAdjacencyMethodHandler implements MethodHandler<TypedAdjacency private static TypeField determineTypeFieldRecursive(final Class<?> type) { TypeField typeField = type.getAnnotation(TypeField.class); if( typeField == null ) { - Class<?>[] parents = type.getInterfaces(); + final Class<?>[] parents = type.getInterfaces(); for( final Class<?> parent : parents ) { typeField = TypedAdjacencyMethodHandler.determineTypeFieldRecursive(parent); if( typeField != null ) diff --git a/src/main/java/com/syncleus/grail/graph/TypedIncidence.java b/src/main/java/com/syncleus/grail/graph/TypedIncidence.java index a589dbd6dbee74152a348f9373efef615b615d66..ffe9e64a5ae2c1cc6f8386b3e965140413c9a129 100644 --- a/src/main/java/com/syncleus/grail/graph/TypedIncidence.java +++ b/src/main/java/com/syncleus/grail/graph/TypedIncidence.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.blueprints.Direction; diff --git a/src/main/java/com/syncleus/grail/graph/TypedIncidenceMethodHandler.java b/src/main/java/com/syncleus/grail/graph/TypedIncidenceMethodHandler.java index 6d40c222b5eb69cdff94329ef1567a8ca3364e68..491f241dc4537679dce8cb2c69a0e528b2784517 100644 --- a/src/main/java/com/syncleus/grail/graph/TypedIncidenceMethodHandler.java +++ b/src/main/java/com/syncleus/grail/graph/TypedIncidenceMethodHandler.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.blueprints.*; @@ -5,8 +23,6 @@ import com.tinkerpop.frames.*; import com.tinkerpop.frames.modules.MethodHandler; import com.tinkerpop.frames.modules.typedgraph.*; import com.tinkerpop.gremlin.java.GremlinPipeline; - -import java.lang.annotation.Annotation; import java.lang.reflect.*; import java.util.*; @@ -28,7 +44,6 @@ public class TypedIncidenceMethodHandler implements MethodHandler<TypedIncidence if( ! (element instanceof Vertex) ) throw new IllegalStateException("element is not a type of Vertex " + element.getClass().getName()); - final Vertex vertex = (Vertex) element; if(annotation.label() == null) throw new IllegalStateException("method " + method.getName() + " label must be specified on @TypedIncidence annotation"); @@ -42,6 +57,8 @@ public class TypedIncidenceMethodHandler implements MethodHandler<TypedIncidence final Class type = (Class) arguments[0]; + final Vertex vertex = (Vertex) element; + if( method.getReturnType().isAssignableFrom(Iterable.class)) return TypedIncidenceMethodHandler.getEdges(type, annotation.direction(), annotation.label(), framedGraph, vertex); @@ -60,12 +77,12 @@ public class TypedIncidenceMethodHandler implements MethodHandler<TypedIncidence final TypeField typeField = TypedIncidenceMethodHandler.determineTypeField(type); switch(direction) { case BOTH: - return framedGraph.frameEdges((Iterable<com.tinkerpop.blueprints.Edge>) new GremlinPipeline<Vertex, Vertex>(vertex).bothE(label).has(typeField.value(), typeValue.value()), type); + return framedGraph.frameEdges((Iterable<Edge>) new GremlinPipeline<Vertex, Vertex>(vertex).bothE(label).has(typeField.value(), typeValue.value()), type); case IN: - return framedGraph.frameEdges((Iterable<com.tinkerpop.blueprints.Edge>) new GremlinPipeline<Vertex, Vertex>(vertex).inE(label).has(typeField.value(), typeValue.value()), type); + return framedGraph.frameEdges((Iterable<Edge>) new GremlinPipeline<Vertex, Vertex>(vertex).inE(label).has(typeField.value(), typeValue.value()), type); //Assume out direction default: - return framedGraph.frameEdges((Iterable<com.tinkerpop.blueprints.Edge>) new GremlinPipeline<Vertex, Vertex>(vertex).outE(label).has(typeField.value(), typeValue.value()), type); + return framedGraph.frameEdges((Iterable<Edge>) new GremlinPipeline<Vertex, Vertex>(vertex).outE(label).has(typeField.value(), typeValue.value()), type); } } @@ -75,12 +92,12 @@ public class TypedIncidenceMethodHandler implements MethodHandler<TypedIncidence final TypeField typeField = TypedIncidenceMethodHandler.determineTypeField(type); switch(direction) { case BOTH: - return framedGraph.frame((com.tinkerpop.blueprints.Edge) new GremlinPipeline<Vertex, Vertex>(vertex).bothE(label).has(typeField.value(), typeValue.value()).next(), type); + return framedGraph.frame((Edge) new GremlinPipeline<Vertex, Vertex>(vertex).bothE(label).has(typeField.value(), typeValue.value()).next(), type); case IN: - return framedGraph.frame((com.tinkerpop.blueprints.Edge) new GremlinPipeline<Vertex, Vertex>(vertex).inE(label).has(typeField.value(), typeValue.value()).next(), type); + return framedGraph.frame((Edge) new GremlinPipeline<Vertex, Vertex>(vertex).inE(label).has(typeField.value(), typeValue.value()).next(), type); //Assume out direction default: - return framedGraph.frame((com.tinkerpop.blueprints.Edge) new GremlinPipeline<Vertex, Vertex>(vertex).outE(label).has(typeField.value(), typeValue.value()).next(), type); + return framedGraph.frame((Edge) new GremlinPipeline<Vertex, Vertex>(vertex).outE(label).has(typeField.value(), typeValue.value()).next(), type); } } @@ -99,14 +116,15 @@ public class TypedIncidenceMethodHandler implements MethodHandler<TypedIncidence private static TypeField determineTypeField(final Class<?> type) { TypeField typeField = type.getAnnotation(TypeField.class); if( typeField == null ) { - Class<?>[] parents = type.getInterfaces(); + final Class<?>[] parents = type.getInterfaces(); for( final Class<?> parent : parents ) { typeField = TypedIncidenceMethodHandler.determineTypeFieldRecursive(parent); if( typeField != null ) return typeField; } - if( typeField == null ) - throw new IllegalArgumentException("The specified type does not have a parent with a typeField annotation."); + + //typeField is known to still be null. + throw new IllegalArgumentException("The specified type does not have a parent with a typeField annotation."); } return typeField; @@ -115,7 +133,7 @@ public class TypedIncidenceMethodHandler implements MethodHandler<TypedIncidence private static TypeField determineTypeFieldRecursive(final Class<?> type) { TypeField typeField = type.getAnnotation(TypeField.class); if( typeField == null ) { - Class<?>[] parents = type.getInterfaces(); + final Class<?>[] parents = type.getInterfaces(); for( final Class<?> parent : parents ) { typeField = TypedIncidenceMethodHandler.determineTypeFieldRecursive(parent); if( typeField != null ) diff --git a/src/main/java/com/syncleus/grail/graph/Weighted.java b/src/main/java/com/syncleus/grail/graph/Weighted.java index 44cf3a1590fd522cc61f6d54864d460cb1b9f4fd..7216652be8e53c183bb9875aa8f1d1845987225e 100644 --- a/src/main/java/com/syncleus/grail/graph/Weighted.java +++ b/src/main/java/com/syncleus/grail/graph/Weighted.java @@ -1,10 +1,28 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.frames.Property; public interface Weighted { @Property("weight") - public Double getWeight(); + Double getWeight(); @Property("weight") - public void setWeight(double weight); + void setWeight(double weight); } diff --git a/src/main/java/com/syncleus/grail/graph/action/AbstractActionTrigger.java b/src/main/java/com/syncleus/grail/graph/action/AbstractActionTrigger.java index 0e705afcc03ada00c3c4d532e0b8021b188abfe9..16e3f35c038418068426d96f32084af957294680 100644 --- a/src/main/java/com/syncleus/grail/graph/action/AbstractActionTrigger.java +++ b/src/main/java/com/syncleus/grail/graph/action/AbstractActionTrigger.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.action; import java.lang.reflect.Method; @@ -13,7 +31,7 @@ public abstract class AbstractActionTrigger implements ActionTrigger { actionMethods = new HashMap<String, Set<Method>>(); AbstractActionTrigger.ACTION_METHOD_CACHE.put(parentClass, actionMethods); - for(Class<?> triggerClass : parentClass.getInterfaces() ) { + for(final Class<?> triggerClass : parentClass.getInterfaces() ) { final Method[] triggerMethods = triggerClass.getMethods(); for (final Method triggerMethod : triggerMethods) { final Action actionAnnotation = triggerMethod.getDeclaredAnnotation(Action.class); diff --git a/src/main/java/com/syncleus/grail/graph/action/AbstractPrioritySerialTrigger.java b/src/main/java/com/syncleus/grail/graph/action/AbstractPrioritySerialTrigger.java index e909eec53010164eebff94dcc16c1427128dc8fd..15bbe8ebe012036d79587f9a9d33fb30230c9cb9 100644 --- a/src/main/java/com/syncleus/grail/graph/action/AbstractPrioritySerialTrigger.java +++ b/src/main/java/com/syncleus/grail/graph/action/AbstractPrioritySerialTrigger.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.action; import com.syncleus.grail.graph.Node; @@ -20,10 +38,10 @@ public abstract class AbstractPrioritySerialTrigger extends AbstractActionTrigge final Class<?> parentClass = triggerObject.getClass(); - Map<String, Set<Method>> actionMethods = AbstractPrioritySerialTrigger.populateCache(parentClass); + final Map<String, Set<Method>> actionMethods = AbstractPrioritySerialTrigger.populateCache(parentClass); final Set<Method> triggerMethods = actionMethods.get(actionName); - if( triggerMethods == null || triggerMethods.size() <= 0 ) + if( triggerMethods == null || triggerMethods.isEmpty() ) throw new IllegalStateException("A ActionTrigger was configured to trigger an action which does not exist on the current object"); for( final Method triggerMethod : triggerMethods ) { diff --git a/src/main/java/com/syncleus/grail/graph/action/Action.java b/src/main/java/com/syncleus/grail/graph/action/Action.java index 580ce74b7cd9104cbdcca5295224ba53eaf9e2c6..ec91a61b47785620826a195911c144522b6aa481 100644 --- a/src/main/java/com/syncleus/grail/graph/action/Action.java +++ b/src/main/java/com/syncleus/grail/graph/action/Action.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.action; import java.lang.annotation.*; diff --git a/src/main/java/com/syncleus/grail/graph/action/ActionTrigger.java b/src/main/java/com/syncleus/grail/graph/action/ActionTrigger.java index d186bd065ca333f058c927dfdb6e1d8ad66679db..5e741771bd8ef57e81fc0c529e7db20bb1900f03 100644 --- a/src/main/java/com/syncleus/grail/graph/action/ActionTrigger.java +++ b/src/main/java/com/syncleus/grail/graph/action/ActionTrigger.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.action; import com.syncleus.grail.graph.*; diff --git a/src/main/java/com/syncleus/grail/graph/action/ActionTriggerEdge.java b/src/main/java/com/syncleus/grail/graph/action/ActionTriggerEdge.java index 4c8e76a786c29a2a0720ab298438fce72572ca99..fd6e8e74f7cd68ee883f4a8eb57753fbd915127b 100644 --- a/src/main/java/com/syncleus/grail/graph/action/ActionTriggerEdge.java +++ b/src/main/java/com/syncleus/grail/graph/action/ActionTriggerEdge.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.action; import com.syncleus.grail.graph.Node; diff --git a/src/main/java/com/syncleus/grail/graph/action/PrioritySerialTrigger.java b/src/main/java/com/syncleus/grail/graph/action/PrioritySerialTrigger.java index 3cd05b5541f05b2b294947999bf7fc6b75832aa1..b05e704307fb93ca5cb9ddc4ba381e7327d55583 100644 --- a/src/main/java/com/syncleus/grail/graph/action/PrioritySerialTrigger.java +++ b/src/main/java/com/syncleus/grail/graph/action/PrioritySerialTrigger.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.action; import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy; diff --git a/src/main/java/com/syncleus/grail/graph/action/PrioritySerialTriggerEdge.java b/src/main/java/com/syncleus/grail/graph/action/PrioritySerialTriggerEdge.java index cc028012225a8acdffdebfe1bd002379aaffe0d0..06f5790d43c60368387be39ed0168613fe90fbef 100644 --- a/src/main/java/com/syncleus/grail/graph/action/PrioritySerialTriggerEdge.java +++ b/src/main/java/com/syncleus/grail/graph/action/PrioritySerialTriggerEdge.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.action; import com.syncleus.grail.graph.Node; diff --git a/src/main/java/com/syncleus/grail/neural/AbstractActivationNeuron.java b/src/main/java/com/syncleus/grail/neural/AbstractActivationNeuron.java index 99c1e70ea780e2e32ae49871ea24f3122a6bfa94..54d97e8056178d50fa43dc3a0eb1c269989c22d9 100644 --- a/src/main/java/com/syncleus/grail/neural/AbstractActivationNeuron.java +++ b/src/main/java/com/syncleus/grail/neural/AbstractActivationNeuron.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural; import com.syncleus.grail.neural.activation.*; diff --git a/src/main/java/com/syncleus/grail/neural/ActivationNeuron.java b/src/main/java/com/syncleus/grail/neural/ActivationNeuron.java index d557278856799489f887b3a96f50d04a595cdc2f..89b30f54840949b8d9083f303041ce834eedb7ec 100644 --- a/src/main/java/com/syncleus/grail/neural/ActivationNeuron.java +++ b/src/main/java/com/syncleus/grail/neural/ActivationNeuron.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural; import com.syncleus.grail.neural.activation.ActivationFunction; diff --git a/src/main/java/com/syncleus/grail/neural/activation/ActivationFunction.java b/src/main/java/com/syncleus/grail/neural/activation/ActivationFunction.java index 7d19a94be38a0c2d90c0ad865b7c9bbf64551972..960d66ce8ad7e13a39366102ebe87ba0b8186d2c 100644 --- a/src/main/java/com/syncleus/grail/neural/activation/ActivationFunction.java +++ b/src/main/java/com/syncleus/grail/neural/activation/ActivationFunction.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.activation; public interface ActivationFunction { diff --git a/src/main/java/com/syncleus/grail/neural/activation/HyperbolicTangentActivationFunction.java b/src/main/java/com/syncleus/grail/neural/activation/HyperbolicTangentActivationFunction.java index da4a426f54c707c25b91dca57f8feeb4e503c4c0..0e9693d57932829788bf543ff17de93720e84a3c 100644 --- a/src/main/java/com/syncleus/grail/neural/activation/HyperbolicTangentActivationFunction.java +++ b/src/main/java/com/syncleus/grail/neural/activation/HyperbolicTangentActivationFunction.java @@ -1,8 +1,27 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.activation; public class HyperbolicTangentActivationFunction implements ActivationFunction { private static final double UPPER_LIMIT = 1.0; private static final double LOWER_LIMIT = -1.0; + private static final double DERIVATIVE_EXP = 2.0; /** * The hyperbolic tangent activation function. @@ -27,7 +46,7 @@ public class HyperbolicTangentActivationFunction implements ActivationFunction { */ @Override public double activateDerivative(final double activity) { - return 1.0 - Math.pow(this.activate(activity), 2.0); + return 1.0 - Math.pow(this.activate(activity), HyperbolicTangentActivationFunction.DERIVATIVE_EXP); } @Override diff --git a/src/main/java/com/syncleus/grail/neural/activation/SineActivationFunction.java b/src/main/java/com/syncleus/grail/neural/activation/SineActivationFunction.java index 7e8d3834862bd21a92ebc3e9ba767b1de44b1cc2..5706b1f21832dbc022ba2d30aae2de9a0e32d3b5 100644 --- a/src/main/java/com/syncleus/grail/neural/activation/SineActivationFunction.java +++ b/src/main/java/com/syncleus/grail/neural/activation/SineActivationFunction.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.activation; public class SineActivationFunction implements ActivationFunction { diff --git a/src/main/java/com/syncleus/grail/neural/backprop/AbstractBackpropNeuron.java b/src/main/java/com/syncleus/grail/neural/backprop/AbstractBackpropNeuron.java index 0a8d9694aa1d7a1e495c31402cfd8d8107acb2be..85b7b643ba3f5f2b012b0c3b8fd587cb7c013ef4 100644 --- a/src/main/java/com/syncleus/grail/neural/backprop/AbstractBackpropNeuron.java +++ b/src/main/java/com/syncleus/grail/neural/backprop/AbstractBackpropNeuron.java @@ -1,12 +1,31 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.backprop; import com.syncleus.grail.neural.*; import com.tinkerpop.frames.modules.javahandler.Initializer; public abstract class AbstractBackpropNeuron extends AbstractActivationNeuron implements BackpropNeuron { + private static final double DEFAULT_LEARNING_RATE = 0.0175; @Initializer public void init() { - this.setLearningRate(0.0175); + this.setLearningRate(AbstractBackpropNeuron.DEFAULT_LEARNING_RATE); this.setDeltaTrain(0.0); } diff --git a/src/main/java/com/syncleus/grail/neural/backprop/BackpropNeuron.java b/src/main/java/com/syncleus/grail/neural/backprop/BackpropNeuron.java index 0110814d9f525a546577efa67c9946ff3e272fff..9e48743913a98912d701319818b024e8c97a16ec 100644 --- a/src/main/java/com/syncleus/grail/neural/backprop/BackpropNeuron.java +++ b/src/main/java/com/syncleus/grail/neural/backprop/BackpropNeuron.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.backprop; import com.syncleus.grail.graph.*; diff --git a/src/main/java/com/syncleus/grail/neural/backprop/BackpropSynapse.java b/src/main/java/com/syncleus/grail/neural/backprop/BackpropSynapse.java index 74d01e630cb711f1714675c501036433838a1e00..dd554f7ba1cb0f0ad2f58e6fc9417c23859b9d97 100644 --- a/src/main/java/com/syncleus/grail/neural/backprop/BackpropSynapse.java +++ b/src/main/java/com/syncleus/grail/neural/backprop/BackpropSynapse.java @@ -1,8 +1,25 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.backprop; import com.syncleus.grail.graph.SignalMultiplyingEdge; import com.tinkerpop.frames.*; -import com.tinkerpop.frames.modules.javahandler.JavaHandlerClass; import com.tinkerpop.frames.modules.typedgraph.TypeValue; @TypeValue("BackpropSynapse") diff --git a/src/main/java/com/syncleus/grail/neural/package-info.java b/src/main/java/com/syncleus/grail/neural/package-info.java index 03e0a8b555917c5b3b9686520a051baeb824208e..4edf6ab86648d47782482e5546bb358b6def8a05 100644 --- a/src/main/java/com/syncleus/grail/neural/package-info.java +++ b/src/main/java/com/syncleus/grail/neural/package-info.java @@ -1 +1,19 @@ -package com.syncleus.grail.neural; \ No newline at end of file +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ +package com.syncleus.grail.neural; diff --git a/src/main/java/com/syncleus/grail/package-info.java b/src/main/java/com/syncleus/grail/package-info.java index 3b68a97cbc5fc402277bb106a5218c548b51d8ee..56e54971973e0b2c852e665cdfc40420e217e109 100644 --- a/src/main/java/com/syncleus/grail/package-info.java +++ b/src/main/java/com/syncleus/grail/package-info.java @@ -1 +1,19 @@ -package com.syncleus.grail; \ No newline at end of file +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ +package com.syncleus.grail; diff --git a/src/test/java/com/syncleus/grail/graph/BlankGraphFactory.java b/src/test/java/com/syncleus/grail/graph/BlankGraphFactory.java index 4f71ebc2f6d68356e6d4a67a76029d8ab5e7c156..b991711b03f39a5abfdd59b821875a883ee5d1ca 100644 --- a/src/test/java/com/syncleus/grail/graph/BlankGraphFactory.java +++ b/src/test/java/com/syncleus/grail/graph/BlankGraphFactory.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.thinkaurelius.titan.core.*; diff --git a/src/test/java/com/syncleus/grail/graph/ExceptionGod.java b/src/test/java/com/syncleus/grail/graph/ExceptionGod.java index 7d3ad424d5ba4fb241f70bbcd1c27ddaca801bfc..1c7fe28ae796d44b968ae30a91825c2dc811c096 100644 --- a/src/test/java/com/syncleus/grail/graph/ExceptionGod.java +++ b/src/test/java/com/syncleus/grail/graph/ExceptionGod.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.blueprints.Direction; diff --git a/src/test/java/com/syncleus/grail/graph/FatherEdge.java b/src/test/java/com/syncleus/grail/graph/FatherEdge.java index fe714511db9433566421216f843598dc3d838037..04067cb50d6ae8d9eb5a14420f23da624ad8103b 100644 --- a/src/test/java/com/syncleus/grail/graph/FatherEdge.java +++ b/src/test/java/com/syncleus/grail/graph/FatherEdge.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.frames.*; diff --git a/src/test/java/com/syncleus/grail/graph/God.java b/src/test/java/com/syncleus/grail/graph/God.java index 9c09e84e343f4d49bec18befaff4f777d7c3fe76..6c5e4a17741cc6750857c73b7a097eaeeaa0355b 100644 --- a/src/test/java/com/syncleus/grail/graph/God.java +++ b/src/test/java/com/syncleus/grail/graph/God.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.blueprints.*; diff --git a/src/test/java/com/syncleus/grail/graph/GodExtended.java b/src/test/java/com/syncleus/grail/graph/GodExtended.java index 2a5e6fe9493ff3414f2c2b89eabb37462ae04b6b..d56d1c2fa128afa20ddaf8c17eeddb0290858512 100644 --- a/src/test/java/com/syncleus/grail/graph/GodExtended.java +++ b/src/test/java/com/syncleus/grail/graph/GodExtended.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy; diff --git a/src/test/java/com/syncleus/grail/graph/Location.java b/src/test/java/com/syncleus/grail/graph/Location.java index 7bbe13db69e96d8bb17b3ed1e5642f836033c1a3..63f0c38f0146a438cfd81035182878f9f637e060 100644 --- a/src/test/java/com/syncleus/grail/graph/Location.java +++ b/src/test/java/com/syncleus/grail/graph/Location.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.frames.*; diff --git a/src/test/java/com/syncleus/grail/graph/LocationExtended.java b/src/test/java/com/syncleus/grail/graph/LocationExtended.java index 53cca60e8fc17f920eb04ff044719912f59cb2f1..dc97b8ea87f94568eca9fdd180b60e4e1674b18d 100644 --- a/src/test/java/com/syncleus/grail/graph/LocationExtended.java +++ b/src/test/java/com/syncleus/grail/graph/LocationExtended.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.frames.Property; diff --git a/src/test/java/com/syncleus/grail/graph/MockTransactionalTinkerGraph.java b/src/test/java/com/syncleus/grail/graph/MockTransactionalTinkerGraph.java index e59168e08717c9fa933721ece2fc998586dcfacf..4080c98bbe561a0db61d5d6e0c8ac231b68920d3 100644 --- a/src/test/java/com/syncleus/grail/graph/MockTransactionalTinkerGraph.java +++ b/src/test/java/com/syncleus/grail/graph/MockTransactionalTinkerGraph.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph; import com.tinkerpop.blueprints.*; diff --git a/src/test/java/com/syncleus/grail/graph/titangraph/BlueprintsTest.java b/src/test/java/com/syncleus/grail/graph/titangraph/BlueprintsTest.java index f018b88129dd51d9600116dc8a644c3a7cc41f79..325cbad2ec31b30cbe7bb48ec1c02c60f7277ade 100644 --- a/src/test/java/com/syncleus/grail/graph/titangraph/BlueprintsTest.java +++ b/src/test/java/com/syncleus/grail/graph/titangraph/BlueprintsTest.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.titangraph; import com.thinkaurelius.titan.core.TitanGraph; diff --git a/src/test/java/com/syncleus/grail/graph/titangraph/FramesTest.java b/src/test/java/com/syncleus/grail/graph/titangraph/FramesTest.java index 41b8f125c37f98da22e47f8fc5bf006309d8a0e0..115bece8c3657ef46f9c6ebf96e98ea3b8aa6ed0 100644 --- a/src/test/java/com/syncleus/grail/graph/titangraph/FramesTest.java +++ b/src/test/java/com/syncleus/grail/graph/titangraph/FramesTest.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.titangraph; import com.syncleus.grail.graph.*; diff --git a/src/test/java/com/syncleus/grail/graph/titangraph/GremlinTest.java b/src/test/java/com/syncleus/grail/graph/titangraph/GremlinTest.java index ed6ff4c1df0f3cb60d858ae58e7fe073e7d3b517..0ecdd179a13aeee2a1fe3556fad283edc4d7f6fc 100644 --- a/src/test/java/com/syncleus/grail/graph/titangraph/GremlinTest.java +++ b/src/test/java/com/syncleus/grail/graph/titangraph/GremlinTest.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.titangraph; import com.thinkaurelius.titan.core.TitanGraph; diff --git a/src/test/java/com/syncleus/grail/graph/titangraph/TitanGods.java b/src/test/java/com/syncleus/grail/graph/titangraph/TitanGods.java index 8f7e269ac50ee6537e457ec937716d5a4633f286..4814b65d8ef458196781079bb37dca54c3d459ee 100644 --- a/src/test/java/com/syncleus/grail/graph/titangraph/TitanGods.java +++ b/src/test/java/com/syncleus/grail/graph/titangraph/TitanGods.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.titangraph; import com.thinkaurelius.titan.core.TitanFactory; diff --git a/src/test/java/com/syncleus/grail/graph/titangraph/TypedAdjacencyHandlerTest.java b/src/test/java/com/syncleus/grail/graph/titangraph/TypedAdjacencyHandlerTest.java index 6bd6484e5fe67f696833768f9222544a324eb50c..be95d989b7217428bffb91fbc1a734a5c557dd9a 100644 --- a/src/test/java/com/syncleus/grail/graph/titangraph/TypedAdjacencyHandlerTest.java +++ b/src/test/java/com/syncleus/grail/graph/titangraph/TypedAdjacencyHandlerTest.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.titangraph; import com.syncleus.grail.graph.*; diff --git a/src/test/java/com/syncleus/grail/graph/titangraph/TypedIncidenceHandlerTest.java b/src/test/java/com/syncleus/grail/graph/titangraph/TypedIncidenceHandlerTest.java index 2b0ae81eda0896e40b94cd09bc44bfa3ef63d01c..f2b89cd123d9f7804a28c33a60a751c20c9594d7 100644 --- a/src/test/java/com/syncleus/grail/graph/titangraph/TypedIncidenceHandlerTest.java +++ b/src/test/java/com/syncleus/grail/graph/titangraph/TypedIncidenceHandlerTest.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.graph.titangraph; import com.syncleus.grail.graph.*; diff --git a/src/test/java/com/syncleus/grail/neural/backprop/ActionTriggerXor3InputTest.java b/src/test/java/com/syncleus/grail/neural/backprop/ActionTriggerXor3InputTest.java index eff2694d2c8f8477c8a47a6ed9a684d37e17d1fa..e02711fb6a661bda7de94ff13a56445d1c4bfb12 100644 --- a/src/test/java/com/syncleus/grail/neural/backprop/ActionTriggerXor3InputTest.java +++ b/src/test/java/com/syncleus/grail/neural/backprop/ActionTriggerXor3InputTest.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.backprop; import com.syncleus.grail.neural.activation.*; diff --git a/src/test/java/com/syncleus/grail/neural/backprop/SimpleOrTest.java b/src/test/java/com/syncleus/grail/neural/backprop/SimpleOrTest.java index 79cc09a4c205017375321ef2782f6c2c2595ceea..37e85a17393f609b8a04162b5a959b3289993cdc 100644 --- a/src/test/java/com/syncleus/grail/neural/backprop/SimpleOrTest.java +++ b/src/test/java/com/syncleus/grail/neural/backprop/SimpleOrTest.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.backprop; import com.syncleus.grail.neural.activation.*; diff --git a/src/test/java/com/syncleus/grail/neural/backprop/SimpleXor2InputTest.java b/src/test/java/com/syncleus/grail/neural/backprop/SimpleXor2InputTest.java index 08bd7d3f8618a1c12f3d6a47bc7c37c556eef7c2..e23752143ee0485a5cc7eb17463482c16a6c80fa 100644 --- a/src/test/java/com/syncleus/grail/neural/backprop/SimpleXor2InputTest.java +++ b/src/test/java/com/syncleus/grail/neural/backprop/SimpleXor2InputTest.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.backprop; import com.syncleus.grail.neural.activation.*; diff --git a/src/test/java/com/syncleus/grail/neural/backprop/SimpleXor3InputTest.java b/src/test/java/com/syncleus/grail/neural/backprop/SimpleXor3InputTest.java index b344e35fac32f3f767581c61d3dd44f51fb54e44..05dfb6ef2e54db8ea4fd0fad2976ba50ce70062b 100644 --- a/src/test/java/com/syncleus/grail/neural/backprop/SimpleXor3InputTest.java +++ b/src/test/java/com/syncleus/grail/neural/backprop/SimpleXor3InputTest.java @@ -1,3 +1,21 @@ +/****************************************************************************** + * * + * Copyright: (c) Syncleus, Inc. * + * * + * You may redistribute and modify this source code under the terms and * + * conditions of the Open Source Community License - Type C version 1.0 * + * or any later version as published by Syncleus, Inc. at www.syncleus.com. * + * There should be a copy of the license included with this file. If a copy * + * of the license is not included you are granted no right to distribute or * + * otherwise use this file except through a legal and valid license. You * + * should also contact Syncleus, Inc. at the information below if you cannot * + * find a license: * + * * + * Syncleus, Inc. * + * 2604 South 12th Street * + * Philadelphia, PA 19148 * + * * + ******************************************************************************/ package com.syncleus.grail.neural.backprop; import com.syncleus.grail.neural.activation.*;