├── .gitignore ├── .travis.yml ├── AUTHORS ├── CONTRIBUTORS ├── HEADER ├── LICENSE ├── NOTICE ├── README.md ├── core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── mwg │ │ │ ├── Callback.java │ │ │ ├── Constants.java │ │ │ ├── DeferCounter.java │ │ │ ├── DeferCounterSync.java │ │ │ ├── Graph.java │ │ │ ├── GraphBuilder.java │ │ │ ├── Node.java │ │ │ ├── NodeIndex.java │ │ │ ├── Query.java │ │ │ ├── Type.java │ │ │ ├── base │ │ │ ├── BaseHook.java │ │ │ ├── BaseNode.java │ │ │ ├── BaseTaskResult.java │ │ │ └── BaseTaskResultIterator.java │ │ │ ├── chunk │ │ │ ├── Chunk.java │ │ │ ├── ChunkSpace.java │ │ │ ├── ChunkType.java │ │ │ ├── GenChunk.java │ │ │ ├── Stack.java │ │ │ ├── StateChunk.java │ │ │ ├── TimeTreeChunk.java │ │ │ ├── TreeWalker.java │ │ │ └── WorldOrderChunk.java │ │ │ ├── internal │ │ │ ├── BlackHoleStorage.java │ │ │ ├── CoreConstants.java │ │ │ ├── CoreGraph.java │ │ │ ├── CoreNodeDeclaration.java │ │ │ ├── CoreNodeIndex.java │ │ │ ├── CoreNodeRegistry.java │ │ │ ├── CoreQuery.java │ │ │ ├── MWGResolver.java │ │ │ ├── chunk │ │ │ │ └── heap │ │ │ │ │ ├── HeapAtomicByteArray.java │ │ │ │ │ ├── HeapChunkSpace.java │ │ │ │ │ ├── HeapContainer.java │ │ │ │ │ ├── HeapDMatrix.java │ │ │ │ │ ├── HeapEGraph.java │ │ │ │ │ ├── HeapENode.java │ │ │ │ │ ├── HeapERelation.java │ │ │ │ │ ├── HeapFixedStack.java │ │ │ │ │ ├── HeapGenChunk.java │ │ │ │ │ ├── HeapLMatrix.java │ │ │ │ │ ├── HeapLongLongArrayMap.java │ │ │ │ │ ├── HeapLongLongMap.java │ │ │ │ │ ├── HeapRelation.java │ │ │ │ │ ├── HeapRelationIndexed.java │ │ │ │ │ ├── HeapStateChunk.java │ │ │ │ │ ├── HeapStringIntMap.java │ │ │ │ │ ├── HeapTimeTreeChunk.java │ │ │ │ │ └── HeapWorldOrderChunk.java │ │ │ ├── memory │ │ │ │ ├── HeapBuffer.java │ │ │ │ └── HeapMemoryFactory.java │ │ │ ├── scheduler │ │ │ │ ├── ExecutorScheduler.java │ │ │ │ ├── HybridScheduler.java │ │ │ │ ├── JobQueue.java │ │ │ │ ├── NoopScheduler.java │ │ │ │ └── TrampolineScheduler.java │ │ │ ├── task │ │ │ │ ├── ActionAddRemoveToGlobalIndex.java │ │ │ │ ├── ActionAddRemoveVarToRelation.java │ │ │ │ ├── ActionAddToVar.java │ │ │ │ ├── ActionAttributes.java │ │ │ │ ├── ActionClearResult.java │ │ │ │ ├── ActionCreateNode.java │ │ │ │ ├── ActionDeclareVar.java │ │ │ │ ├── ActionDefineAsVar.java │ │ │ │ ├── ActionExecuteExpression.java │ │ │ │ ├── ActionFlat.java │ │ │ │ ├── ActionFlipVar.java │ │ │ │ ├── ActionGlobalIndex.java │ │ │ │ ├── ActionIndexNames.java │ │ │ │ ├── ActionInject.java │ │ │ │ ├── ActionLog.java │ │ │ │ ├── ActionLookup.java │ │ │ │ ├── ActionLookupAll.java │ │ │ │ ├── ActionNamed.java │ │ │ │ ├── ActionPrint.java │ │ │ │ ├── ActionReadGlobalIndex.java │ │ │ │ ├── ActionReadVar.java │ │ │ │ ├── ActionRemove.java │ │ │ │ ├── ActionSave.java │ │ │ │ ├── ActionScript.java │ │ │ │ ├── ActionSelect.java │ │ │ │ ├── ActionSelectObject.java │ │ │ │ ├── ActionSetAsVar.java │ │ │ │ ├── ActionSetAttribute.java │ │ │ │ ├── ActionTimeSensitivity.java │ │ │ │ ├── ActionTimepoints.java │ │ │ │ ├── ActionTravelInTime.java │ │ │ │ ├── ActionTravelInWorld.java │ │ │ │ ├── ActionTraverseOrAttribute.java │ │ │ │ ├── ActionWith.java │ │ │ │ ├── ActionWithout.java │ │ │ │ ├── CF_Action.java │ │ │ │ ├── CF_Atomic.java │ │ │ │ ├── CF_DoWhile.java │ │ │ │ ├── CF_ForEach.java │ │ │ │ ├── CF_ForEachPar.java │ │ │ │ ├── CF_IfThen.java │ │ │ │ ├── CF_IfThenElse.java │ │ │ │ ├── CF_Loop.java │ │ │ │ ├── CF_LoopPar.java │ │ │ │ ├── CF_Map.java │ │ │ │ ├── CF_MapPar.java │ │ │ │ ├── CF_Pipe.java │ │ │ │ ├── CF_PipePar.java │ │ │ │ ├── CF_PipeTo.java │ │ │ │ ├── CF_ThenDo.java │ │ │ │ ├── CF_WhileDo.java │ │ │ │ ├── CoreActionDeclaration.java │ │ │ │ ├── CoreActionNames.java │ │ │ │ ├── CoreActionRegistry.java │ │ │ │ ├── CoreActions.java │ │ │ │ ├── CoreTask.java │ │ │ │ ├── CoreTaskContext.java │ │ │ │ ├── CoreTaskReader.java │ │ │ │ ├── CoreTaskResultIterator.java │ │ │ │ ├── TaskHelper.java │ │ │ │ └── math │ │ │ │ │ ├── CoreMathExpressionEngine.java │ │ │ │ │ ├── MathConditional.java │ │ │ │ │ ├── MathDoubleToken.java │ │ │ │ │ ├── MathEntities.java │ │ │ │ │ ├── MathExpressionEngine.java │ │ │ │ │ ├── MathExpressionTokenizer.java │ │ │ │ │ ├── MathFreeToken.java │ │ │ │ │ ├── MathFunction.java │ │ │ │ │ ├── MathOperation.java │ │ │ │ │ └── MathToken.java │ │ │ └── utility │ │ │ │ ├── CoreDeferCounter.java │ │ │ │ ├── CoreDeferCounterSync.java │ │ │ │ └── ReadOnlyStorage.java │ │ │ ├── plugin │ │ │ ├── ActionDeclaration.java │ │ │ ├── ActionFactory.java │ │ │ ├── ActionRegistry.java │ │ │ ├── Job.java │ │ │ ├── MemoryFactory.java │ │ │ ├── NodeDeclaration.java │ │ │ ├── NodeFactory.java │ │ │ ├── NodeRegistry.java │ │ │ ├── NodeState.java │ │ │ ├── NodeStateCallback.java │ │ │ ├── Plugin.java │ │ │ ├── Resolver.java │ │ │ ├── ResolverFactory.java │ │ │ ├── Scheduler.java │ │ │ ├── SchedulerAffinity.java │ │ │ ├── Storage.java │ │ │ └── TaskExecutor.java │ │ │ ├── struct │ │ │ ├── Buffer.java │ │ │ ├── BufferIterator.java │ │ │ ├── DMatrix.java │ │ │ ├── EGraph.java │ │ │ ├── ENode.java │ │ │ ├── ERelation.java │ │ │ ├── LMatrix.java │ │ │ ├── LongLongArrayMap.java │ │ │ ├── LongLongArrayMapCallBack.java │ │ │ ├── LongLongMap.java │ │ │ ├── LongLongMapCallBack.java │ │ │ ├── Map.java │ │ │ ├── Relation.java │ │ │ ├── RelationIndexed.java │ │ │ ├── StringIntMap.java │ │ │ └── StringLongMapCallBack.java │ │ │ ├── task │ │ │ ├── Action.java │ │ │ ├── ActionFunction.java │ │ │ ├── ConditionalFunction.java │ │ │ ├── Task.java │ │ │ ├── TaskActionFactory.java │ │ │ ├── TaskContext.java │ │ │ ├── TaskFunctionSelect.java │ │ │ ├── TaskFunctionSelectObject.java │ │ │ ├── TaskHook.java │ │ │ ├── TaskResult.java │ │ │ ├── TaskResultIterator.java │ │ │ └── Tasks.java │ │ │ └── utility │ │ │ ├── Base64.java │ │ │ ├── BufferView.java │ │ │ ├── DefaultBufferIterator.java │ │ │ ├── Enforcer.java │ │ │ ├── EnforcerChecker.java │ │ │ ├── HashHelper.java │ │ │ ├── KeyHelper.java │ │ │ ├── Tuple.java │ │ │ ├── Unsafe.java │ │ │ ├── VerboseHook.java │ │ │ └── VerbosePlugin.java │ ├── javadoc │ │ ├── org │ │ │ └── mwg │ │ │ │ ├── package-info.java │ │ │ │ ├── plugin │ │ │ │ └── package-info.java │ │ │ │ ├── struct │ │ │ │ └── package-info.java │ │ │ │ └── task │ │ │ │ └── package-info.java │ │ └── overview.html │ └── resources │ │ └── package.json │ └── test │ ├── java │ └── org │ │ └── mwg │ │ └── internal │ │ ├── Benchmark2Test.java │ │ ├── Benchmark3Test.java │ │ ├── Benchmark4Test.java │ │ ├── Benchmark5Test.java │ │ ├── BenchmarkParTest.java │ │ ├── BenchmarkTest.java │ │ ├── DephasingFlagTest.java │ │ ├── FlagTest.java │ │ ├── GraphRobustness.java │ │ ├── HelloWorldTest.java │ │ ├── IndexTest.java │ │ ├── LookupAllTest.java │ │ ├── MiniFlagTest.java │ │ ├── MockStorage.java │ │ ├── NodeFactoryTest.java │ │ ├── QueryTest.java │ │ ├── SuperTimeTest.java │ │ ├── TimeSensitivityTest.java │ │ ├── TimelineTest.java │ │ ├── chunk │ │ ├── AbstractChunkSpaceTest.java │ │ ├── AbstractEGraphTest.java │ │ ├── AbstractFixedStackTest.java │ │ ├── AbstractGenChunkTest.java │ │ ├── AbstractLongLongArrayMapTest.java │ │ ├── AbstractLongLongMapTest.java │ │ ├── AbstractMatrixTest.java │ │ ├── AbstractRelationTest.java │ │ ├── AbstractStateChunkTest.java │ │ ├── AbstractStringIntMapTest.java │ │ ├── AbstractTimeTreeTest.java │ │ ├── AbstractWorldOrderChunkTest.java │ │ └── heap │ │ │ ├── ChunkMicroBenchmark.java │ │ │ ├── HeapChunkSpaceTest.java │ │ │ ├── HeapDMatrixTest.java │ │ │ ├── HeapEGraphTest.java │ │ │ ├── HeapFixedStackTest.java │ │ │ ├── HeapGenChunkTest.java │ │ │ ├── HeapLongLongArrayMapTest.java │ │ │ ├── HeapLongLongMapTest.java │ │ │ ├── HeapRelationTest.java │ │ │ ├── HeapStateChunkTest.java │ │ │ ├── HeapStringIntMapTest.java │ │ │ ├── HeapTimeTreeChunkTest.java │ │ │ └── HeapWorldOrderChunkTest.java │ │ ├── memory │ │ ├── AbstractBufferTest.java │ │ └── heap │ │ │ └── HeapBufferTest.java │ │ ├── scheduler │ │ ├── ExecutorSchedulerTest.java │ │ ├── HybridSchedulerTest.java │ │ └── TrampolineSchedulerTest.java │ │ ├── task │ │ ├── AbstractActionTest.java │ │ ├── ActionAddRemoveVarToRelationTest.java │ │ ├── ActionAddToGlobalIndexTest.java │ │ ├── ActionForeachParTest.java │ │ ├── ActionForeachTest.java │ │ ├── ActionFromIndexAllTest.java │ │ ├── ActionFromIndexTest.java │ │ ├── ActionIfThenTest.java │ │ ├── ActionIndexNamesTest.java │ │ ├── ActionInjectTest.java │ │ ├── ActionLocalIndexOrUnindexTest.java │ │ ├── ActionLookupTest.java │ │ ├── ActionMapTest.java │ │ ├── ActionNewNodeTest.java │ │ ├── ActionPropertiesTest.java │ │ ├── ActionReadVarTest.java │ │ ├── ActionRemoveFromRelationPropertyTest.java │ │ ├── ActionRemoveFromRelationTest.java │ │ ├── ActionScriptTest.java │ │ ├── ActionSelectObjectTest.java │ │ ├── ActionSelectScriptTest.java │ │ ├── ActionSelectTest.java │ │ ├── ActionSetAsVarTest.java │ │ ├── ActionSetAttributeTest.java │ │ ├── ActionSetPropertyTest.java │ │ ├── ActionSetTimeTest.java │ │ ├── ActionSetWorldTest.java │ │ ├── ActionTimepointsTest.java │ │ ├── ActionTravelInTimeTest.java │ │ ├── ActionTraverseOrAttributeTest.java │ │ ├── ActionTraverseOrKeepTest.java │ │ ├── ActionTraverseTest.java │ │ ├── ActionWhileDoTest.java │ │ ├── ActionWithTest.java │ │ ├── ActionWithoutTest.java │ │ ├── ContextCleanTest.java │ │ ├── CoreTaskContextTests.java │ │ ├── CrashTaskTest.java │ │ ├── DFSTest.java │ │ ├── FlagTest.java │ │ ├── HookTest.java │ │ ├── MicroWorldTest.java │ │ ├── ParseTest.java │ │ ├── RobustnessTests.java │ │ ├── SmallWorldTest.java │ │ ├── TaskOutputTest.java │ │ └── math │ │ │ └── MathEngineTest.java │ │ └── utility │ │ ├── Base64Test.java │ │ ├── DataHasherTest.java │ │ ├── HashHelperTest.java │ │ └── HashTest.java │ └── resources │ └── debug.html ├── deploy.sh ├── doc ├── .gitignore ├── README.md ├── SUMMARY.md ├── js │ ├── README.md │ ├── bower_mwg_sample.zip │ └── browser.md ├── logo.png ├── ml │ ├── README.md │ ├── ml_graph.graffle │ ├── ml_graph.png │ └── polynomial.md ├── scheduler.md ├── start │ ├── README.md │ ├── distributed.md │ ├── indexing.md │ ├── many_world_graph.graffle │ ├── many_world_graph.png │ ├── manyworld.md │ ├── minimal.md │ ├── persistence.md │ ├── temporal.md │ ├── temporal_graph.graffle │ └── temporal_graph.png ├── storage │ └── protocol.md └── tasks │ ├── Context.md │ ├── Execute.md │ ├── Hook.md │ ├── Query.md │ ├── README.md │ ├── actions │ ├── README.md │ ├── add.md │ ├── addTo.md │ ├── asGlobalVar.md │ ├── asVar.md │ ├── fromIndex.md │ ├── fromIndexAll.md │ ├── get.md │ ├── indexNode.md │ ├── localIndex.md │ ├── localUnindex.md │ ├── loop.md │ ├── loopPar.md │ ├── propertiesNames.md │ ├── propertiesNamesWithTypes.md │ ├── setProperty.md │ └── traverse.md │ ├── running_example.graffle │ └── running_example.png ├── install.sh ├── plugins ├── README.md ├── benchmark │ ├── data │ │ ├── 1.json │ │ ├── 2.json │ │ └── 3.json │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── mwg │ │ │ └── benchmark │ │ │ ├── JsonHandler.java │ │ │ ├── NoopCallback.java │ │ │ ├── Runner.java │ │ │ ├── Server.java │ │ │ ├── TrampolineCallback.java │ │ │ └── TrampolineTask.java │ │ └── resources │ │ └── static │ │ ├── c3.css │ │ ├── c3.js │ │ ├── d3.js │ │ ├── index.html │ │ └── moment.js ├── debug │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── mwg │ │ │ │ └── debug │ │ │ │ ├── JsonHook.java │ │ │ │ ├── TaskServerPlugin.java │ │ │ │ └── TaskTraceRegistry.java │ │ └── resources │ │ │ ├── css │ │ │ ├── bulma.css │ │ │ ├── default-theme.css │ │ │ ├── goldenlayout-base.css │ │ │ ├── goldenlayout-dark-theme.css │ │ │ ├── goldenlayout-light-theme.css │ │ │ ├── goldenlayout-soda-theme.css │ │ │ └── goldenlayout-translucent-theme.css │ │ │ ├── index.html │ │ │ └── js │ │ │ ├── EventBus.js │ │ │ ├── goldenlayout.js │ │ │ ├── jquery-3.1.1.js │ │ │ └── json-formatter.js │ │ └── test │ │ └── java │ │ └── org │ │ └── mwg │ │ └── debug │ │ └── TaskServerPluginTest.java ├── importer │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ └── importer │ │ │ ├── ActionReadFiles.java │ │ │ ├── ActionReadLines.java │ │ │ ├── ActionSplit.java │ │ │ ├── ImporterActions.java │ │ │ ├── ImporterPlugin.java │ │ │ └── util │ │ │ └── IterableLines.java │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── mwg │ │ │ └── ImporterTest.java │ │ └── resources │ │ ├── activity │ │ ├── OrdonezA_ADLs.txt │ │ ├── OrdonezA_Description.txt │ │ ├── OrdonezA_Sensors.txt │ │ ├── OrdonezB_ADLs.txt │ │ ├── OrdonezB_Description.txt │ │ ├── OrdonezB_Sensors.txt │ │ ├── README.txt │ │ └── readme.md │ │ ├── folder with spaces in name │ │ └── aFile.txt │ │ ├── readme.md │ │ ├── sample.geojson │ │ ├── smarthome │ │ ├── readme.md │ │ ├── smarthome_1.T15.txt │ │ ├── smarthome_2.T15.txt │ │ └── smarthome_mini_1.T15.txt │ │ └── smartmeters │ │ ├── readme.md │ │ └── smart_meter_06_07.txt ├── memory │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ └── memory │ │ │ └── offheap │ │ │ ├── OffHeapBuffer.java │ │ │ ├── OffHeapChunkSpace.java │ │ │ ├── OffHeapConstants.java │ │ │ ├── OffHeapContainer.java │ │ │ ├── OffHeapDMatrix.java │ │ │ ├── OffHeapEGraph.java │ │ │ ├── OffHeapENode.java │ │ │ ├── OffHeapERelation.java │ │ │ ├── OffHeapFixedStack.java │ │ │ ├── OffHeapGenChunk.java │ │ │ ├── OffHeapLMatrix.java │ │ │ ├── OffHeapLongLongArrayMap.java │ │ │ ├── OffHeapLongLongMap.java │ │ │ ├── OffHeapMemoryFactory.java │ │ │ ├── OffHeapMemoryPlugin.java │ │ │ ├── OffHeapRelation.java │ │ │ ├── OffHeapRelationIndexed.java │ │ │ ├── OffHeapStateChunk.java │ │ │ ├── OffHeapStringIntMap.java │ │ │ ├── OffHeapTimeTreeChunk.java │ │ │ ├── OffHeapVolatileContainer.java │ │ │ ├── OffHeapWorldOrderChunk.java │ │ │ └── primary │ │ │ ├── OffHeapByteArray.java │ │ │ ├── OffHeapDoubleArray.java │ │ │ ├── OffHeapIntArray.java │ │ │ ├── OffHeapLongArray.java │ │ │ ├── OffHeapString.java │ │ │ └── OffHeapStringArray.java │ │ └── test │ │ └── java │ │ └── org │ │ └── mwg │ │ └── memory │ │ └── offheap │ │ ├── BenchmarkChunk.java │ │ ├── BenchmarkParTask.java │ │ ├── OffHeapBufferTest.java │ │ ├── OffHeapByteArrayTest.java │ │ ├── OffHeapChunkSpaceTest.java │ │ ├── OffHeapDMatrixTest.java │ │ ├── OffHeapEGraphTest.java │ │ ├── OffHeapFixedStackTest.java │ │ ├── OffHeapGenChunkTest.java │ │ ├── OffHeapLongLongArrayMapTest.java │ │ ├── OffHeapLongLongMapTest.java │ │ ├── OffHeapRelationTest.java │ │ ├── OffHeapStateChunkTest.java │ │ ├── OffHeapStringIntMapTest.java │ │ ├── OffHeapTimeTreeChunkTest.java │ │ └── OffHeapWorldOrderChunkTest.java ├── ml │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ └── ml │ │ │ ├── AnomalyDetectionNode.java │ │ │ ├── BaseMLNode.java │ │ │ ├── ClassificationNode.java │ │ │ ├── ClusteringNode.java │ │ │ ├── MLPlugin.java │ │ │ ├── ProfilingNode.java │ │ │ ├── ProgressReporter.java │ │ │ ├── RegressionNode.java │ │ │ ├── actions │ │ │ └── ActionTraverseOrKeep.java │ │ │ ├── algorithm │ │ │ ├── anomalydetector │ │ │ │ └── InterquartileRangeOutlierDetectorNode.java │ │ │ ├── preprocessing │ │ │ │ └── PCA.java │ │ │ ├── profiling │ │ │ │ ├── GaussianMixtureNode.java │ │ │ │ ├── GaussianNode.java │ │ │ │ ├── GaussianSlotNode.java │ │ │ │ ├── GaussianTreeNode.java.old │ │ │ │ ├── KMeans.java │ │ │ │ ├── ProbaDistribution.java │ │ │ │ └── ProbaDistribution2.java │ │ │ └── regression │ │ │ │ ├── LiveLinearRegressionNode.java │ │ │ │ ├── PolynomialNode.java │ │ │ │ └── actions │ │ │ │ ├── ReadContinuous.java │ │ │ │ ├── SetContinuous.java │ │ │ │ └── SetPrecision.java │ │ │ ├── analytics │ │ │ └── AttributeNode.java │ │ │ ├── common │ │ │ ├── DecisionTreeNode.java │ │ │ ├── NDimentionalArray.java │ │ │ ├── distance │ │ │ │ └── GaussianDistance.java │ │ │ └── matrix │ │ │ │ ├── HybridMatrixEngine.java │ │ │ │ ├── MatrixEngine.java │ │ │ │ ├── MatrixOps.java │ │ │ │ ├── SVDDecompose.java │ │ │ │ ├── TransposeType.java │ │ │ │ ├── VolatileDMatrix.java │ │ │ │ ├── blassolver │ │ │ │ ├── BlasMatrixEngine.java │ │ │ │ ├── JobSVD.java │ │ │ │ ├── LU.java │ │ │ │ ├── QR.java │ │ │ │ ├── SVD.java │ │ │ │ └── blas │ │ │ │ │ ├── Blas.java │ │ │ │ │ ├── BlasHelper.java │ │ │ │ │ ├── F2JBlas.java │ │ │ │ │ └── NetlibBlas.java │ │ │ │ ├── jamasolver │ │ │ │ ├── JamaMatrixEngine.java │ │ │ │ ├── LU.java │ │ │ │ ├── QR.java │ │ │ │ ├── SVD.java │ │ │ │ └── Utils.java │ │ │ │ └── operation │ │ │ │ ├── Gaussian1D.java │ │ │ │ ├── MultivariateNormalDistribution.java │ │ │ │ ├── PInvSVD.java │ │ │ │ └── PolynomialFit.java │ │ │ ├── neuralnet │ │ │ ├── FlatNeuralNode.java │ │ │ ├── NeuralFunction.java │ │ │ ├── NeuralNode.java │ │ │ ├── NeuralNodeEmpty.java │ │ │ ├── NeuralNodeType.java │ │ │ ├── bio │ │ │ │ ├── BioInputNeuralNode.java │ │ │ │ ├── BioNeuralNetwork.java │ │ │ │ ├── BioNeuralNode.java │ │ │ │ └── BioOutputNeuralNode.java │ │ │ └── functions │ │ │ │ ├── LinearFunction.java │ │ │ │ └── SigmoidFunction.java │ │ │ └── nn │ │ │ └── ExMatrix.java │ │ └── test │ │ └── java │ │ └── org │ │ └── mwg │ │ └── ml │ │ ├── ExtractFeatureTest.java │ │ ├── NDArrayTest.java │ │ ├── NoopRegressionNode.java │ │ ├── anomalydetector │ │ └── InterquartileRangeOutlierDetectorNodeTest.java │ │ ├── common │ │ ├── EnforcerTest.java │ │ ├── MultiplyTest.java │ │ ├── OpsTest.java │ │ └── PolynomialSolveTest.java │ │ ├── neuralnet │ │ ├── FlatNeuralNodeTest.java │ │ └── NeuralNodeTest.java │ │ ├── preprocessing │ │ └── TestPCA.java │ │ ├── profiling │ │ ├── GaussianMixtureModelTest.java │ │ └── GaussianNodeTest.java │ │ └── regression │ │ ├── LiveLinearRegressionTest.java │ │ ├── PolynomialNodeTest.java │ │ └── TestPolynomialRandom.java ├── mlext │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ ├── MLExtPlugin.java │ │ │ └── mlext │ │ │ └── NeuralNetAttribute.java │ │ └── test │ │ └── java │ │ └── org │ │ └── mwg │ │ └── mlext │ │ └── NeuralNetAttributeTest.java ├── mlx │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ └── mlx │ │ │ ├── MLXPlugin.java │ │ │ └── algorithm │ │ │ ├── AbstractAnySlidingWindowManagingNode.java │ │ │ ├── AbstractAnySlidingWindowManagingRegressionNode.java │ │ │ ├── AbstractClassifierSlidingWindowManagingNode.java │ │ │ ├── AbstractGaussianClassifierNode.java │ │ │ ├── AbstractLRGradientDescentNode.java │ │ │ ├── AbstractLinearRegressionNode.java │ │ │ ├── classifier │ │ │ ├── BatchDecisionTreeNode.java │ │ │ ├── GaussianClassifierNode.java │ │ │ ├── GaussianNaiveBayesianNode.java │ │ │ ├── LogisticRegressionClassifierNode.java │ │ │ └── StreamDecisionTreeNode.java │ │ │ ├── clustering │ │ │ └── KMeansNode.java │ │ │ └── regression │ │ │ ├── AutoregressionBasedPeriodicityDetector.java │ │ │ ├── LinearRegressionBatchGDNode.java │ │ │ ├── LinearRegressionNode.java │ │ │ ├── LinearRegressionSGDNode.java │ │ │ └── LinearRegressionWithPeriodicityNode.java │ │ └── test │ │ └── java │ │ ├── common │ │ ├── HashCollision.java │ │ └── matrix │ │ │ └── GaussianProbaTest.java │ │ └── ml │ │ ├── GaussianMixtureSim.java │ │ ├── TestTMP.java │ │ ├── classifier │ │ ├── AbstractClassifierTest.java │ │ ├── BatchDecisionTreeNodeTest.java │ │ ├── GaussianClassifierTest.java │ │ ├── GaussianNaiveBayesianTest.java │ │ ├── Generator.java │ │ └── LogisticRegressionTest.java │ │ └── regression │ │ ├── AbstractLinearRegressionTest.java │ │ ├── AutoregressionBasedPeriodicityDetectorTest.java │ │ ├── LightScenarioTests.java │ │ ├── LinearRegressionBatchGDNodeTest.java │ │ ├── LinearRegressionNodeTest.java │ │ ├── LinearRegressionPeriodicNodeTest.java │ │ └── LinearRegressionSGDNodeTest.java ├── model │ ├── .gitignore │ ├── dsl │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── antlr4 │ │ │ └── MetaModel.g4 │ │ │ ├── exemples │ │ │ ├── cloud.mm │ │ │ ├── hello.mm │ │ │ └── ml_1.mm │ │ │ └── java │ │ │ └── org │ │ │ └── kevoree │ │ │ └── modeling │ │ │ └── ast │ │ │ ├── KAttribute.java │ │ │ ├── KClass.java │ │ │ ├── KClassifier.java │ │ │ ├── KDependency.java │ │ │ ├── KEnum.java │ │ │ ├── KIndex.java │ │ │ ├── KModel.java │ │ │ ├── KProperty.java │ │ │ ├── KRelation.java │ │ │ ├── ModelBuilder.java │ │ │ └── impl │ │ │ ├── Attribute.java │ │ │ ├── Class.java │ │ │ ├── Dependency.java │ │ │ ├── Enum.java │ │ │ ├── Index.java │ │ │ ├── Model.java │ │ │ ├── Property.java │ │ │ └── Relation.java │ ├── generator │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── kmf │ │ │ │ └── generator │ │ │ │ └── Generator.java │ │ │ └── test │ │ │ ├── java │ │ │ └── org │ │ │ │ └── kmf │ │ │ │ └── generator │ │ │ │ └── GeneratorTest.java │ │ │ └── resources │ │ │ └── hello.mm │ ├── mavenplugin │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── kmf │ │ │ └── maven │ │ │ └── GenPlugin.java │ ├── pom.xml │ └── sample │ │ ├── pom.xml │ │ └── src │ │ ├── hello.mm │ │ └── main │ │ └── java │ │ └── HelloWorld.java ├── native │ ├── pom.xml │ └── src │ │ └── main │ │ ├── c │ │ ├── compile.sh │ │ └── org_mwg_NativeHasherHelper.c │ │ ├── java │ │ └── org │ │ │ └── mwg │ │ │ └── NativeHasherHelper.java │ │ └── resources │ │ └── natives.dylib ├── rest │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── doc │ │ ├── idea.jpeg │ │ └── idea.key │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── kevoree │ │ │ └── modeling │ │ │ └── addons │ │ │ └── rest │ │ │ └── RestGateway.java │ │ └── test │ │ └── java │ │ └── org │ │ └── kevoree │ │ └── modeling │ │ └── addons │ │ └── rest │ │ └── GetPostTest.java ├── search │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── mwg │ │ └── SearchEngine.java ├── storage │ ├── cassandra │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── mwg │ │ │ │ └── CassandraStorage.java │ │ │ └── test │ │ │ └── java │ │ │ └── org.mwg │ │ │ └── StorageTest.java │ ├── dyno │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ └── DynoClient.java │ ├── hazelcast │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ ├── HazelcastJob.java │ │ │ ├── HazelcastScheduler.java │ │ │ └── HazelcastTest.java │ ├── hbase │ │ ├── README.md │ │ ├── pkg │ │ │ └── docker │ │ │ │ ├── Dockerfile │ │ │ │ └── conf │ │ │ │ ├── hbase-env.sh │ │ │ │ ├── hbase-site.xml │ │ │ │ └── log4j.properties │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── mwg │ │ │ │ ├── HBaseStorage.java │ │ │ │ └── HBaseThriftStorage.java │ │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ ├── StorageTest.java │ │ │ └── StorageTest2.java │ ├── leveldb │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── mwg │ │ │ │ └── LevelDBStorage.java │ │ │ └── test │ │ │ └── java │ │ │ └── leveldb │ │ │ ├── IndexTest.java │ │ │ └── StorageTest.java │ ├── nats │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ ├── NatsClient.java │ │ │ └── NatsServer.java │ ├── riak │ │ ├── pkg │ │ │ └── docker │ │ │ │ └── docker-compose.yml │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── mwg │ │ │ │ └── RiakStorage.java │ │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ └── StorageTest.java │ ├── rocksdb │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── mwg │ │ │ │ └── RocksDBStorage.java │ │ │ └── test │ │ │ └── java │ │ │ └── rocksdb │ │ │ ├── IndexTest.java │ │ │ └── StorageTest.java │ ├── voldemort │ │ ├── docker │ │ │ └── Dockerfile │ │ ├── lib │ │ │ └── voldemort-1.10.23.jar │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── mwg │ │ │ │ └── VoldemortStorage.java │ │ │ └── test │ │ │ └── java │ │ │ └── voldemort │ │ │ └── StorageTest.java │ └── websocket │ │ ├── .gitignore │ │ ├── debug │ │ └── index.html │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── mwg │ │ │ │ ├── ChunkKey.java │ │ │ │ ├── WSClient.java │ │ │ │ ├── WSConstants.java │ │ │ │ └── WSServer.java │ │ └── ts │ │ │ ├── mwg.d.ts │ │ │ ├── mwg.ws.js │ │ │ ├── mwg.ws.ts │ │ │ ├── package.json │ │ │ ├── reconnecting-websocket.js │ │ │ └── reconnecting-websocket.ts │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── mwg │ │ │ ├── TaskServerTest.java │ │ │ └── WSServerTest.java │ │ └── resources │ │ └── hello │ │ └── world ├── structure │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── mwg │ │ │ └── structure │ │ │ ├── StructurePlugin.java │ │ │ ├── Tree.java │ │ │ ├── TreeResult.java │ │ │ ├── action │ │ │ └── NearestNWithinRadius.java │ │ │ ├── distance │ │ │ ├── CosineDistance.java │ │ │ ├── Distance.java │ │ │ ├── Distances.java │ │ │ ├── EuclideanDistance.java │ │ │ ├── GeoDistance.java │ │ │ └── PearsonDistance.java │ │ │ ├── trees │ │ │ ├── IndexStrategy.java │ │ │ ├── KDTree.java │ │ │ └── NDTree.java │ │ │ └── util │ │ │ ├── HRect.java │ │ │ ├── TreeHelper.java │ │ │ └── VolatileResult.java │ │ └── test │ │ └── java │ │ └── org │ │ └── mwg │ │ └── structure │ │ ├── KDTreeJava.java │ │ ├── NNL2.java │ │ └── trees │ │ ├── NDTreeTest.java │ │ └── TestSort.java ├── taskide │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── mwg │ │ │ │ └── TaskIDE.java │ │ └── web │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── config │ │ │ ├── env.js │ │ │ ├── jest │ │ │ │ ├── CSSStub.js │ │ │ │ └── FileStub.js │ │ │ ├── paths.js │ │ │ ├── polyfills.js │ │ │ ├── webpack.config.dev.js │ │ │ └── webpack.config.prod.js │ │ │ ├── package.json │ │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── mwg.js │ │ │ └── mwg.ws.js │ │ │ ├── scripts │ │ │ ├── build.js │ │ │ ├── start.js │ │ │ └── test.js │ │ │ └── src │ │ │ ├── TaskEditor.js │ │ │ ├── index.css │ │ │ └── index.js │ │ └── test │ │ └── java │ │ └── org │ │ └── mwg │ │ └── TaskServerTest.java └── visualizer │ ├── .gitignore │ ├── README.md │ ├── old │ ├── .babelrc │ ├── .bowerrc │ ├── README.md │ ├── bower.json │ ├── gulpfile.js │ ├── index.html │ ├── java │ │ └── mwg-sample │ │ │ ├── pom.xml │ │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── mwg.sample │ │ │ └── DebugServer.java │ ├── lib │ │ └── all-mwg.min.js │ ├── package.json │ ├── pom.xml │ └── src │ │ ├── js │ │ ├── demo_mwg.js │ │ ├── demo_vivagraph.js │ │ └── react_layout.js │ │ └── scss │ │ ├── goldenlayout-base.scss │ │ ├── goldenlayout-personal-theme.scss │ │ └── style.scss │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── mwg │ │ │ └── visualizer │ │ │ ├── DebugVisualizerServer.java │ │ │ └── VisualizerServer.java │ ├── resources │ │ ├── css │ │ │ ├── goldenlayout-base.css │ │ │ ├── goldenlayout-light-theme.css │ │ │ ├── ion.rangeSlider.css │ │ │ ├── ion.rangeSlider.skinFlat.css │ │ │ └── visualizer.css │ │ ├── img │ │ │ └── sprite-skin-flat.png │ │ ├── index.html │ │ ├── js │ │ │ ├── goldenlayout.js │ │ │ ├── ion.rangeSlider.min.js │ │ │ ├── jquery-1.11.1.min.js │ │ │ └── vivagraph.js │ │ ├── min │ │ │ └── vs │ │ │ │ ├── base │ │ │ │ ├── common │ │ │ │ │ └── worker │ │ │ │ │ │ ├── simpleWorker.js │ │ │ │ │ │ ├── simpleWorker.nls.de.js │ │ │ │ │ │ ├── simpleWorker.nls.es.js │ │ │ │ │ │ ├── simpleWorker.nls.fr.js │ │ │ │ │ │ ├── simpleWorker.nls.it.js │ │ │ │ │ │ ├── simpleWorker.nls.ja.js │ │ │ │ │ │ ├── simpleWorker.nls.js │ │ │ │ │ │ ├── simpleWorker.nls.ko.js │ │ │ │ │ │ ├── simpleWorker.nls.ru.js │ │ │ │ │ │ ├── simpleWorker.nls.zh-cn.js │ │ │ │ │ │ ├── simpleWorker.nls.zh-tw.js │ │ │ │ │ │ ├── workerServer.js │ │ │ │ │ │ ├── workerServer.nls.de.js │ │ │ │ │ │ ├── workerServer.nls.es.js │ │ │ │ │ │ ├── workerServer.nls.fr.js │ │ │ │ │ │ ├── workerServer.nls.it.js │ │ │ │ │ │ ├── workerServer.nls.ja.js │ │ │ │ │ │ ├── workerServer.nls.js │ │ │ │ │ │ ├── workerServer.nls.ko.js │ │ │ │ │ │ ├── workerServer.nls.ru.js │ │ │ │ │ │ ├── workerServer.nls.zh-cn.js │ │ │ │ │ │ └── workerServer.nls.zh-tw.js │ │ │ │ └── worker │ │ │ │ │ ├── workerMain.js │ │ │ │ │ └── workerMainCompatibility.html │ │ │ │ ├── basic-languages │ │ │ │ └── src │ │ │ │ │ ├── bat.js │ │ │ │ │ ├── coffee.js │ │ │ │ │ ├── cpp.js │ │ │ │ │ ├── csharp.js │ │ │ │ │ ├── css.js │ │ │ │ │ ├── dockerfile.js │ │ │ │ │ ├── fsharp.js │ │ │ │ │ ├── go.js │ │ │ │ │ ├── ini.js │ │ │ │ │ ├── jade.js │ │ │ │ │ ├── java.js │ │ │ │ │ ├── less.js │ │ │ │ │ ├── lua.js │ │ │ │ │ ├── markdown.js │ │ │ │ │ ├── objective-c.js │ │ │ │ │ ├── postiats.js │ │ │ │ │ ├── powershell.js │ │ │ │ │ ├── python.js │ │ │ │ │ ├── r.js │ │ │ │ │ ├── ruby.js │ │ │ │ │ ├── scss.js │ │ │ │ │ ├── sql.js │ │ │ │ │ ├── swift.js │ │ │ │ │ ├── vb.js │ │ │ │ │ └── xml.js │ │ │ │ ├── css.js │ │ │ │ ├── editor │ │ │ │ ├── contrib │ │ │ │ │ ├── quickOpen │ │ │ │ │ │ └── browser │ │ │ │ │ │ │ └── symbol-sprite.svg │ │ │ │ │ └── suggest │ │ │ │ │ │ └── browser │ │ │ │ │ │ └── symbol-sprite.svg │ │ │ │ ├── editor.main.css │ │ │ │ ├── editor.main.js │ │ │ │ ├── editor.main.nls.de.js │ │ │ │ ├── editor.main.nls.es.js │ │ │ │ ├── editor.main.nls.fr.js │ │ │ │ ├── editor.main.nls.it.js │ │ │ │ ├── editor.main.nls.ja.js │ │ │ │ ├── editor.main.nls.js │ │ │ │ ├── editor.main.nls.ko.js │ │ │ │ ├── editor.main.nls.ru.js │ │ │ │ ├── editor.main.nls.zh-cn.js │ │ │ │ └── editor.main.nls.zh-tw.js │ │ │ │ ├── language │ │ │ │ ├── css │ │ │ │ │ ├── cssMode.js │ │ │ │ │ └── cssWorker.js │ │ │ │ ├── json │ │ │ │ │ ├── jsonMode.js │ │ │ │ │ └── jsonWorker.js │ │ │ │ └── typescript │ │ │ │ │ ├── lib │ │ │ │ │ └── typescriptServices.js │ │ │ │ │ └── src │ │ │ │ │ ├── mode.js │ │ │ │ │ └── worker.js │ │ │ │ ├── languages │ │ │ │ ├── handlebars │ │ │ │ │ └── common │ │ │ │ │ │ └── handlebars.js │ │ │ │ ├── html │ │ │ │ │ └── common │ │ │ │ │ │ ├── html.js │ │ │ │ │ │ ├── htmlWorker.js │ │ │ │ │ │ ├── htmlWorker.nls.de.js │ │ │ │ │ │ ├── htmlWorker.nls.es.js │ │ │ │ │ │ ├── htmlWorker.nls.fr.js │ │ │ │ │ │ ├── htmlWorker.nls.it.js │ │ │ │ │ │ ├── htmlWorker.nls.ja.js │ │ │ │ │ │ ├── htmlWorker.nls.js │ │ │ │ │ │ ├── htmlWorker.nls.ko.js │ │ │ │ │ │ ├── htmlWorker.nls.ru.js │ │ │ │ │ │ ├── htmlWorker.nls.zh-cn.js │ │ │ │ │ │ └── htmlWorker.nls.zh-tw.js │ │ │ │ ├── lib │ │ │ │ │ └── common │ │ │ │ │ │ └── beautify-html.js │ │ │ │ ├── php │ │ │ │ │ └── common │ │ │ │ │ │ └── php.js │ │ │ │ └── razor │ │ │ │ │ └── common │ │ │ │ │ ├── razor.js │ │ │ │ │ └── razorWorker.js │ │ │ │ ├── loader.js │ │ │ │ └── nls.js │ │ └── website │ │ │ └── js │ │ │ ├── graphVisualizer.js │ │ │ ├── layout.js │ │ │ └── mwg │ │ │ ├── mwg.js │ │ │ ├── mwg.min.js │ │ │ ├── mwg.ws.js │ │ │ └── mwg.ws.min.js │ └── ts │ │ ├── graphVisualizer.ts │ │ ├── layout.ts │ │ ├── ts2js.ts │ │ └── tsconfig.json │ └── test │ └── java │ └── test │ ├── DummyTest.java │ └── DummyTest2.java ├── pom.xml ├── release.sh └── share ├── build_netlib ├── LICENSE ├── README.md ├── gulpfile.js ├── package.json ├── src │ ├── blas-files.js │ ├── export-functions.js │ ├── export.js │ ├── lapack-files.js │ └── libf2c-files.js └── test │ ├── .eslintrc │ ├── blas-level1 │ ├── daxpy.js │ ├── dcopy.js │ └── ddot.js │ ├── blas-level2 │ └── dgemv.js │ ├── blas-level3 │ ├── dgemm.js │ └── dsyrk.js │ └── lapack │ ├── dsyev.js │ └── dsysv.js ├── compiler.jar ├── debug └── debug.html ├── mwg.blas.ts ├── netlib.js ├── package.json ├── spacer.js ├── tar.gz.xml ├── test.js └── zip.xml /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | release.properties 7 | dependency-reduced-pom.xml 8 | buildNumber.properties 9 | .idea 10 | .DS_Store 11 | */.DS_Store 12 | *.iml 13 | .settings/ 14 | .classpath 15 | .project 16 | *.csv 17 | /tempStorage/ 18 | /fullTempStorage/ 19 | /fullTempStorage2/ 20 | plugins/storage/cassandra/src/main/resources/ 21 | plugins/taskide/src/main/web/node_modules/ 22 | 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | notifications: 5 | email: 6 | recipients: 7 | - francois.fouquet@uni.lu 8 | - gregory.nain@uni.lu 9 | - thomas.hartmann@uni.lu 10 | - assaad.moawad@uni.lu 11 | - ludovic.mouline@uni.lu 12 | - andrey.boytsov@uni.lu 13 | on_success: change 14 | on_failure: change 15 | 16 | #Compile only master branch 17 | branches: 18 | only: 19 | - master 20 | - draftNewGenerator 21 | 22 | env: 23 | - TRAVIS_NODE_VERSION="4" 24 | 25 | before_install: 26 | - echo "MAVEN_OPTS='-Xmx2048m -XX:MaxPermSize=512m'" > ~/.mavenrc 27 | - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION 28 | - node -v 29 | 30 | install: mvn clean 31 | script: mvn clean install 32 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of MWG authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as: 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | DataThings 10 | University of Luxembourg 11 | Francois Fouquet (fouquet.f@gmail.com) 12 | Thomas Hartmann (thomi.hartmann@gmail.com) 13 | Assaad Mouawad (assaadmouawad@gmail.com) 14 | Gregory Nain (gregory.nain@gmail.com) -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of MWG contributors. 2 | # This file is distinct from the AUTHORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as: 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | Matthieu Jimenez (matthieu@jimenez.lu) 10 | Ludovic Mouline -------------------------------------------------------------------------------- /HEADER: -------------------------------------------------------------------------------- 1 | Copyright 2017 The MWG Authors. All rights reserved. 2 |

3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 |

7 | http://www.apache.org/licenses/LICENSE-2.0 8 |

9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | NOTICE file for use with, and corresponding to Section 4 of, 3 | the Apache License, Version 2.0, 4 | in this case for the MWG project. 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | 9 | Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com) 10 | Copyright (c) 2011 The LevelDB Authors. All rights reserved. 11 | 12 | The RocksDB Authors, Facebook 13 | Copyright (c) 2011-present, Facebook, Inc.. All rights reserved. 14 | 15 | The netlib and netlib-java Authors 16 | Copyright (c) 2013 Samuel Halliday 17 | Copyright (c) 1992-2013 The University of Tennessee and The University of Tennessee Research Foundation. All rights reserved. 18 | Copyright (c) 2000-2013 The University of California Berkeley. All rights reserved. 19 | Copyright (c) 2006-2013 The University of Colorado Denver. All rights reserved. 20 | 21 | The minimal-json Authors 22 | Copyright (c) 2013, 2014 EclipseSource 23 | 24 | The undertow Authors 25 | Copyright undertow-io 26 | 27 | The ANTLR Authors 28 | Copyright (c) 2012-2016 The ANTLR Project. All rights reserved. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Many-World Graph 2 | ================== 3 | 4 | 5 | 6 | MWG has been renamed as GreyCat :-) 7 | Please follow us now at the following repository: 8 | 9 | https://github.com/datathings/greycat 10 | 11 | See you there :-) 12 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/Callback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg; 17 | 18 | /** 19 | *

Generic structure to define tasks to be executed when an asynchronous result is released.

20 | * In Java 8, Typescript and JavaScript, this structure can be replaced by a closure. 21 | * 22 | * @param The type of the expected result. 23 | */ 24 | @FunctionalInterface 25 | public interface Callback { 26 | 27 | /** 28 | * This method is called when an asynchronous result is delivered. 29 | * 30 | * @param result The expected result. 31 | */ 32 | void on(A result); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/DeferCounterSync.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg; 17 | 18 | /** 19 | * DeferCounter provides a mean to wait for an amount of events before running a method. 20 | */ 21 | public interface DeferCounterSync extends DeferCounter { 22 | 23 | Object waitResult(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/NodeIndex.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg; 17 | 18 | public interface NodeIndex extends Node { 19 | 20 | long size(); 21 | 22 | long[] all(); 23 | 24 | NodeIndex addToIndex(Node node, String... attributeNames); 25 | 26 | NodeIndex removeFromIndex(Node node, String... attributeNames); 27 | 28 | NodeIndex clear(); 29 | 30 | void find(Callback callback, String... params); 31 | 32 | void findByQuery(Query query, Callback callback); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/chunk/Chunk.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.chunk; 17 | 18 | import org.mwg.struct.Buffer; 19 | 20 | public interface Chunk { 21 | 22 | long world(); 23 | 24 | long time(); 25 | 26 | long id(); 27 | 28 | byte chunkType(); 29 | 30 | long index(); 31 | 32 | void save(Buffer buffer); 33 | 34 | void saveDiff(Buffer buffer); 35 | 36 | void load(Buffer buffer); 37 | 38 | void loadDiff(Buffer buffer); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/chunk/ChunkType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.chunk; 17 | 18 | public class ChunkType { 19 | 20 | public static final byte STATE_CHUNK = 0; 21 | 22 | public static final byte TIME_TREE_CHUNK = 1; 23 | 24 | public static final byte WORLD_ORDER_CHUNK = 2; 25 | 26 | public static final byte GEN_CHUNK = 3; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/chunk/GenChunk.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.chunk; 17 | 18 | public interface GenChunk extends Chunk { 19 | 20 | long newKey(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/chunk/Stack.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.chunk; 17 | 18 | public interface Stack { 19 | 20 | boolean enqueue(long index); 21 | 22 | long dequeueTail(); 23 | 24 | boolean dequeue(long index); 25 | 26 | void free(); 27 | 28 | long size(); 29 | 30 | } -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/chunk/StateChunk.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.chunk; 17 | 18 | import org.mwg.plugin.NodeState; 19 | 20 | public interface StateChunk extends Chunk, NodeState { 21 | 22 | void loadFrom(StateChunk origin); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/chunk/TimeTreeChunk.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.chunk; 17 | 18 | public interface TimeTreeChunk extends Chunk { 19 | 20 | void insert(long key); 21 | 22 | void unsafe_insert(long key); 23 | 24 | long previousOrEqual(long key); 25 | 26 | void clearAt(long max); 27 | 28 | void range(long startKey, long endKey, long maxElements, TreeWalker walker); 29 | 30 | long magic(); 31 | 32 | long previous(long key); 33 | 34 | long next(long key); 35 | 36 | int size(); 37 | 38 | long extra(); 39 | 40 | void setExtra(long extraValue); 41 | 42 | long extra2(); 43 | 44 | void setExtra2(long extraValue); 45 | 46 | } -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/chunk/TreeWalker.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.chunk; 17 | 18 | @FunctionalInterface 19 | public interface TreeWalker { 20 | 21 | void elem(long t); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/chunk/WorldOrderChunk.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.chunk; 17 | 18 | import org.mwg.struct.LongLongMap; 19 | 20 | public interface WorldOrderChunk extends Chunk, LongLongMap { 21 | 22 | long magic(); 23 | 24 | void lock(); 25 | 26 | void unlock(); 27 | 28 | void externalLock(); 29 | 30 | void externalUnlock(); 31 | 32 | long extra(); 33 | 34 | void setExtra(long extraValue); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/internal/CoreNodeDeclaration.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal; 17 | 18 | import org.mwg.plugin.NodeDeclaration; 19 | import org.mwg.plugin.NodeFactory; 20 | 21 | class CoreNodeDeclaration implements NodeDeclaration { 22 | 23 | private final String _name; 24 | private NodeFactory _factory; 25 | 26 | CoreNodeDeclaration(String name) { 27 | _name = name; 28 | } 29 | 30 | @Override 31 | public final String name() { 32 | return _name; 33 | } 34 | 35 | @Override 36 | public final NodeFactory factory() { 37 | return _factory; 38 | } 39 | 40 | @Override 41 | public final void setFactory(NodeFactory newFactory) { 42 | _factory = newFactory; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/internal/chunk/heap/HeapContainer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | public interface HeapContainer { 19 | 20 | void declareDirty(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/internal/memory/HeapMemoryFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.memory; 17 | 18 | import org.mwg.Graph; 19 | import org.mwg.chunk.ChunkSpace; 20 | import org.mwg.internal.chunk.heap.HeapChunkSpace; 21 | import org.mwg.plugin.MemoryFactory; 22 | import org.mwg.struct.Buffer; 23 | 24 | public class HeapMemoryFactory implements MemoryFactory { 25 | 26 | @Override 27 | public ChunkSpace newSpace(long memorySize, Graph graph, boolean deepWorld) { 28 | return new HeapChunkSpace((int) memorySize, graph, deepWorld); 29 | } 30 | 31 | @Override 32 | public Buffer newBuffer() { 33 | return new HeapBuffer(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/internal/scheduler/NoopScheduler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.scheduler; 17 | 18 | import org.mwg.plugin.Job; 19 | import org.mwg.plugin.Scheduler; 20 | 21 | public class NoopScheduler implements Scheduler { 22 | 23 | @Override 24 | public void dispatch(byte affinity, Job job) { 25 | job.run(); 26 | } 27 | 28 | @Override 29 | public void start() { 30 | //noop 31 | } 32 | 33 | @Override 34 | public void stop() { 35 | //noop 36 | } 37 | 38 | @Override 39 | public int workers() { 40 | return 1; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/internal/task/math/MathDoubleToken.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.task.math; 17 | 18 | class MathDoubleToken implements MathToken { 19 | 20 | private final double _content; 21 | 22 | MathDoubleToken(double _content) { 23 | this._content = _content; 24 | } 25 | 26 | @Override 27 | public int type() { 28 | return 2; 29 | } 30 | 31 | double content() { 32 | return this._content; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/internal/task/math/MathExpressionEngine.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.task.math; 17 | 18 | import org.mwg.Node; 19 | import org.mwg.task.TaskContext; 20 | 21 | import java.util.Map; 22 | 23 | public interface MathExpressionEngine { 24 | 25 | double eval(Node context, TaskContext taskContext, Map variables); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/internal/task/math/MathFreeToken.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.task.math; 17 | 18 | class MathFreeToken implements MathToken { 19 | 20 | private String _content; 21 | 22 | MathFreeToken(String content) { 23 | this._content = content; 24 | } 25 | 26 | String content() { 27 | return this._content; 28 | } 29 | 30 | @Override 31 | public int type() { 32 | return 3; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/internal/task/math/MathToken.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.task.math; 17 | 18 | interface MathToken { 19 | 20 | int type(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/ActionDeclaration.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | public interface ActionDeclaration { 19 | 20 | ActionFactory factory(); 21 | 22 | ActionDeclaration setFactory(ActionFactory factory); 23 | 24 | byte[] params(); 25 | 26 | ActionDeclaration setParams(byte... params); 27 | 28 | String description(); 29 | 30 | ActionDeclaration setDescription(String description); 31 | 32 | String name(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/ActionFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | import org.mwg.task.Action; 19 | 20 | @FunctionalInterface 21 | public interface ActionFactory { 22 | 23 | Action create(Object[] params); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/ActionRegistry.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | 19 | public interface ActionRegistry { 20 | 21 | ActionDeclaration declaration(String name); 22 | 23 | ActionDeclaration[] declarations(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/Job.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | /** 19 | * Unit of computation of Many World Graph 20 | */ 21 | @FunctionalInterface 22 | public interface Job { 23 | /** 24 | * Trigger the unit of computation 25 | */ 26 | void run(); 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/MemoryFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | import org.mwg.Graph; 19 | import org.mwg.chunk.ChunkSpace; 20 | import org.mwg.struct.Buffer; 21 | 22 | public interface MemoryFactory { 23 | 24 | ChunkSpace newSpace(long memorySize, Graph graph, boolean deepPriority); 25 | 26 | Buffer newBuffer(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/NodeDeclaration.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | public interface NodeDeclaration { 19 | 20 | String name(); 21 | 22 | NodeFactory factory(); 23 | 24 | void setFactory(NodeFactory newFactory); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/NodeRegistry.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | public interface NodeRegistry { 19 | 20 | NodeDeclaration declaration(String name); 21 | 22 | NodeDeclaration declarationByHash(int hash); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/NodeStateCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | @FunctionalInterface 19 | public interface NodeStateCallback { 20 | 21 | void on(int attributeKey, byte elemType, Object elem); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/Plugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | import org.mwg.Graph; 19 | 20 | public interface Plugin { 21 | 22 | void start(Graph graph); 23 | 24 | void stop(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/ResolverFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | import org.mwg.chunk.ChunkSpace; 19 | 20 | public interface ResolverFactory { 21 | 22 | Resolver newResolver(Storage storage, ChunkSpace space); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/SchedulerAffinity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | public class SchedulerAffinity { 19 | 20 | public final static byte SAME_THREAD = 0; 21 | 22 | public final static byte ANY_LOCAL_THREAD = 1; 23 | 24 | public final static byte OTHER_LOCAL_THREAD = 2; 25 | 26 | public final static byte ANY_REMOTE_THREAD = 3; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/plugin/TaskExecutor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.plugin; 17 | 18 | import org.mwg.Callback; 19 | import org.mwg.task.Task; 20 | 21 | public interface TaskExecutor { 22 | 23 | void executeTasks(Callback callback, Task... tasks); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/struct/BufferIterator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.struct; 17 | 18 | public interface BufferIterator { 19 | 20 | boolean hasNext(); 21 | 22 | Buffer next(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/struct/EGraph.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.struct; 17 | 18 | import org.mwg.Graph; 19 | 20 | public interface EGraph { 21 | 22 | ENode root(); 23 | 24 | ENode newNode(); 25 | 26 | EGraph setRoot(ENode eNode); 27 | 28 | EGraph drop(ENode eNode); 29 | 30 | int size(); 31 | 32 | void free(); 33 | 34 | Graph graph(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/struct/ENode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.struct; 17 | 18 | import org.mwg.plugin.NodeStateCallback; 19 | 20 | public interface ENode { 21 | 22 | ENode set(String name, byte type, Object value); 23 | 24 | ENode setAt(int key, byte type, Object value); 25 | 26 | Object get(String name); 27 | 28 | Object getAt(int key); 29 | 30 | Object getOrCreate(final String key, final byte type); 31 | 32 | Object getOrCreateAt(final int key, final byte type); 33 | 34 | void drop(); 35 | 36 | EGraph graph(); 37 | 38 | void each(final NodeStateCallback callBack); 39 | 40 | ENode clear(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/struct/ERelation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.struct; 17 | 18 | public interface ERelation { 19 | 20 | ENode[] nodes(); 21 | 22 | ENode node(int index); 23 | 24 | int size(); 25 | 26 | ERelation add(ENode eNode); 27 | 28 | ERelation addAll(ENode[] eNodes); 29 | 30 | ERelation clear(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/struct/LongLongArrayMapCallBack.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.struct; 17 | 18 | @FunctionalInterface 19 | public interface LongLongArrayMapCallBack { 20 | void on(long key, long value); 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/struct/LongLongMapCallBack.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.struct; 17 | 18 | @FunctionalInterface 19 | public interface LongLongMapCallBack { 20 | void on(long key, long value); 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/struct/Map.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.struct; 17 | 18 | public interface Map { 19 | 20 | /** 21 | * Size of the getOrCreateMap 22 | * 23 | * @return the size of the getOrCreateMap 24 | */ 25 | int size(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/struct/RelationIndexed.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.struct; 17 | 18 | import org.mwg.Callback; 19 | import org.mwg.Node; 20 | import org.mwg.Query; 21 | 22 | public interface RelationIndexed { 23 | 24 | int size(); 25 | 26 | long[] all(); 27 | 28 | RelationIndexed add(Node node, String... attributeNames); 29 | 30 | RelationIndexed remove(Node node, String... attributeNames); 31 | 32 | RelationIndexed clear(); 33 | 34 | void find(Callback callback, long world, long time, String... params); 35 | 36 | void findByQuery(Query query, Callback callback); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/struct/StringLongMapCallBack.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.struct; 17 | 18 | @FunctionalInterface 19 | public interface StringLongMapCallBack { 20 | void on(String key, long value); 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/task/Action.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.task; 17 | 18 | public interface Action { 19 | 20 | void eval(TaskContext ctx); 21 | 22 | void serialize(StringBuilder builder); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/task/ActionFunction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.task; 17 | 18 | @FunctionalInterface 19 | public interface ActionFunction { 20 | void eval(TaskContext ctx); 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/task/ConditionalFunction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.task; 17 | 18 | @FunctionalInterface 19 | public interface ConditionalFunction { 20 | boolean eval(TaskContext ctx); 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/task/TaskActionFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.task; 17 | 18 | import java.util.Map; 19 | 20 | @FunctionalInterface 21 | public interface TaskActionFactory { 22 | 23 | Action create(String[] params, Map contextTasks); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/task/TaskFunctionSelect.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.task; 17 | 18 | import org.mwg.Node; 19 | 20 | /** 21 | * Task closure function to select nodes for next action 22 | */ 23 | @FunctionalInterface 24 | public interface TaskFunctionSelect { 25 | 26 | /** 27 | * Selection function called that specify if a specified node 28 | * will be in the result set or not 29 | * 30 | * @param node node to select or not for next action 31 | * @param context current context 32 | * @return true to keep this node for the next action 33 | */ 34 | boolean select(Node node, TaskContext context); 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/task/TaskFunctionSelectObject.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.task; 17 | 18 | @FunctionalInterface 19 | public interface TaskFunctionSelectObject { 20 | boolean select(Object object, TaskContext context); 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/task/TaskHook.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.task; 17 | 18 | public interface TaskHook { 19 | 20 | void start(TaskContext initialContext); 21 | 22 | void beforeAction(Action action, TaskContext context); 23 | 24 | void afterAction(Action action, TaskContext context); 25 | 26 | void beforeTask(TaskContext parentContext, TaskContext context); 27 | 28 | void afterTask(TaskContext context); 29 | 30 | void end(TaskContext finalContext); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/task/TaskResultIterator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.task; 17 | 18 | import org.mwg.utility.Tuple; 19 | 20 | public interface TaskResultIterator { 21 | 22 | A next(); 23 | 24 | Tuple nextWithIndex(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/utility/EnforcerChecker.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.utility; 17 | 18 | public interface EnforcerChecker { 19 | 20 | void check(byte inputType, Object input) throws RuntimeException; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/utility/KeyHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.utility; 17 | 18 | import org.mwg.Constants; 19 | 20 | public class KeyHelper { 21 | 22 | public static void keyToBuffer(org.mwg.struct.Buffer buffer, byte chunkType, long world, long time, long id) { 23 | Base64.encodeIntToBuffer((int) chunkType, buffer); 24 | buffer.write(Constants.KEY_SEP); 25 | Base64.encodeLongToBuffer(world, buffer); 26 | buffer.write(Constants.KEY_SEP); 27 | Base64.encodeLongToBuffer(time, buffer); 28 | buffer.write(Constants.KEY_SEP); 29 | Base64.encodeLongToBuffer(id, buffer); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/utility/Tuple.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.utility; 17 | 18 | public class Tuple { 19 | 20 | private A _left; 21 | private B _right; 22 | 23 | public Tuple(A p_left, B p_right) { 24 | this._left = p_left; 25 | this._right = p_right; 26 | } 27 | 28 | public A left() { 29 | return _left; 30 | } 31 | 32 | public B right() { 33 | return _right; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/mwg/utility/VerbosePlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.utility; 17 | 18 | import org.mwg.Graph; 19 | import org.mwg.plugin.Plugin; 20 | 21 | public class VerbosePlugin implements Plugin { 22 | 23 | @Override 24 | public void start(Graph graph) { 25 | graph.addGlobalTaskHook(new VerboseHook()); 26 | } 27 | 28 | @Override 29 | public void stop() { 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/javadoc/org/mwg/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * This is the core package for the application 18 | */ 19 | package org.mwg; -------------------------------------------------------------------------------- /core/src/main/javadoc/org/mwg/plugin/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Contains all utility classes and interfaces used for the development of MWG plugins. 18 | */ 19 | package org.mwg.plugin; -------------------------------------------------------------------------------- /core/src/main/javadoc/org/mwg/struct/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * This package contains all data exchange structures interfaces used in MWG. 18 | */ 19 | package org.mwg.struct; -------------------------------------------------------------------------------- /core/src/main/javadoc/org/mwg/task/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * The tasks package encompasses all classes and interfaces related to Tasks 18 | */ 19 | package org.mwg.task; -------------------------------------------------------------------------------- /core/src/main/javadoc/overview.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | The Many World Graph is a fantastic tool ! 21 |

22 | MWG provides the necessary mechanisms for deep data analytics. 23 |

24 | 25 | -------------------------------------------------------------------------------- /core/src/main/resources/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mwg", 3 | "version": "1.0.0", 4 | "main": "mwg.js", 5 | "typings": "mwg.d.ts" 6 | } -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapChunkSpaceTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractChunkSpaceTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapChunkSpaceTest extends AbstractChunkSpaceTest { 22 | 23 | public HeapChunkSpaceTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapDMatrixTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractMatrixTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapDMatrixTest extends AbstractMatrixTest { 22 | 23 | public HeapDMatrixTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapEGraphTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractEGraphTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapEGraphTest extends AbstractEGraphTest { 22 | 23 | public HeapEGraphTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapFixedStackTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.junit.Test; 19 | import org.mwg.internal.chunk.AbstractFixedStackTest; 20 | 21 | public class HeapFixedStackTest extends AbstractFixedStackTest { 22 | 23 | @Test 24 | public void heapFixedStackTest() { 25 | test(new HeapFixedStack(CAPACITY, true)); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapGenChunkTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractGenChunkTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapGenChunkTest extends AbstractGenChunkTest { 22 | 23 | public HeapGenChunkTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapLongLongArrayMapTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractLongLongArrayMapTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapLongLongArrayMapTest extends AbstractLongLongArrayMapTest { 22 | 23 | public HeapLongLongArrayMapTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapLongLongMapTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractLongLongMapTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapLongLongMapTest extends AbstractLongLongMapTest { 22 | 23 | public HeapLongLongMapTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapRelationTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractRelationTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapRelationTest extends AbstractRelationTest { 22 | 23 | public HeapRelationTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapStateChunkTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractStateChunkTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapStateChunkTest extends AbstractStateChunkTest { 22 | 23 | public HeapStateChunkTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapStringIntMapTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractStringIntMapTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapStringIntMapTest extends AbstractStringIntMapTest { 22 | 23 | public HeapStringIntMapTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapTimeTreeChunkTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractTimeTreeTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapTimeTreeChunkTest extends AbstractTimeTreeTest { 22 | 23 | public HeapTimeTreeChunkTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/chunk/heap/HeapWorldOrderChunkTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.chunk.heap; 17 | 18 | import org.mwg.internal.chunk.AbstractWorldOrderChunkTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapWorldOrderChunkTest extends AbstractWorldOrderChunkTest { 22 | 23 | public HeapWorldOrderChunkTest() { 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/java/org/mwg/internal/memory/heap/HeapBufferTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.internal.memory.heap; 17 | 18 | import org.mwg.internal.memory.AbstractBufferTest; 19 | import org.mwg.internal.memory.HeapMemoryFactory; 20 | 21 | public class HeapBufferTest extends AbstractBufferTest { 22 | 23 | public HeapBufferTest(){ 24 | super(new HeapMemoryFactory()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/test/resources/debug.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2017 The MWG Authors. All rights reserved. 4 | #

5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | #

9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | #

11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | export JAVA_HOME=$(/usr/libexec/java_home) 19 | mvn clean deploy -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | _book -------------------------------------------------------------------------------- /doc/SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [Introduction](README.md) 4 | * [Quick start](start/README.md) 5 | * [First minimal graph](start/minimal.md) 6 | * [Temporal graph](start/temporal.md) 7 | * [Many world graph](start/manyworld.md) 8 | * [Persistence](start/persistence.md) 9 | * [Indexing](start/indexing.md) 10 | * [Distributed graph](start/distributed.md) 11 | * [Tasks](tasks/README.md) 12 | * [Context and variables](tasks/Context.md) 13 | * [Actions](tasks/actions/README.md) 14 | * [add](tasks/actions/add.md) 15 | * [addTo](tasks/actions/addTo.md) 16 | * [asVar](tasks/actions/asVar.md) 17 | * [asGlobalVar](tasks/actions/asGlobalVar.md) 18 | * [get](tasks/actions/get.md) 19 | * [loop](tasks/actions/loop.md) 20 | * [loopPar](tasks/actions/loopPar.md) 21 | * [setProperty](tasks/actions/setProperty.md) 22 | * [traverse](tasks/actions/traverse.md) 23 | * [Execution methods](tasks/Execute.md) 24 | * [Hooks and Debug](tasks/Hook.md) 25 | * [Scheduler](scheduler.md) 26 | * [Machine learning](ml/README.md) 27 | * [Polynomial compression](ml/polynomial.md) 28 | * [JavaScript](js/README.md) 29 | * [Browser](js/browser.md) 30 | -------------------------------------------------------------------------------- /doc/js/README.md: -------------------------------------------------------------------------------- 1 | # JavaScript API 2 | 3 | Through a transpiler to TypeScript, MWG offers its core modules and various plugins for JavaScript powered runtimes. A transpilation process ensures a one to one mapping between Java and JS APIs. For the rest of this section, browser and NodeJS technologies are relevant. 4 | 5 | ## Modules available in JS: 6 | - Core [download (v7)](https://repo.maven.apache.org/maven2/org/kevoree/mwg/core/7/core-7-js.zip) 7 | - Structure [download (v7)](https://repo.maven.apache.org/maven2/org/kevoree/mwg/plugins/structure/7/structure-7-js.zip) 8 | - WebSocket [download (v7)](https://repo.maven.apache.org/maven2/org/kevoree/mwg/plugins/websocket/7/websocket-7-js.zip) 9 | - ML [download (v7)](https://repo.maven.apache.org/maven2/org/kevoree/mwg/plugins/ml/7/ml-7-js.zip) -------------------------------------------------------------------------------- /doc/js/bower_mwg_sample.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/js/bower_mwg_sample.zip -------------------------------------------------------------------------------- /doc/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/logo.png -------------------------------------------------------------------------------- /doc/ml/README.md: -------------------------------------------------------------------------------- 1 | # MWG machine learning library 2 | 3 | MWG provides a built-in machine learning library that allows to seamlessly mix learning into a graph, i.e., it allows to create graphs which are composed of learned nodes and 'normal' graph nodes, just like indicated in the figure below. 4 |

5 | 6 |
7 | 8 | 9 | > Why mixing learning and domain data? 10 | 11 | To make smart decisions, intelligent systems have to continuously refine behaviour that is known at design time with what can be learned only from live data to solve known unknowns. 12 | Machine learning algorithms are designed to resolve unknown behaviours by extracting commonalities over massive datasets. 13 | MWG allows to decompose machine learning into reusable, chainable, and independently computable learning units. These can be modelled together with and at the same level than domain data. 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/ml/ml_graph.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/ml/ml_graph.graffle -------------------------------------------------------------------------------- /doc/ml/ml_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/ml/ml_graph.png -------------------------------------------------------------------------------- /doc/scheduler.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/scheduler.md -------------------------------------------------------------------------------- /doc/start/README.md: -------------------------------------------------------------------------------- 1 | # Quick start 2 | 3 | MWG is distributed over maven repository. 4 | Therefore it can be used with maven, ivy, sbt... 5 | 6 | Simply add the api and core module dependency to your project and start using MWG api such as: 7 | 8 | ``` xml 9 | 10 | org.kevoree.mwg 11 | api 12 | ${mwg.version} 13 | 14 | 15 | org.kevoree.mwg 16 | core 17 | ${mwg.version} 18 | 19 | ``` 20 | 21 | Next go for the next session for your first graph. -------------------------------------------------------------------------------- /doc/start/many_world_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/start/many_world_graph.png -------------------------------------------------------------------------------- /doc/start/minimal.md: -------------------------------------------------------------------------------- 1 | # A simple graph 2 | 3 | Create and connect a simple graph using the following code 4 | 5 | ```java 6 | Graph g = new GraphBuilder().build(); 7 | g.connect(isconnected-> { 8 | //your next code goes here... 9 | }); 10 | ``` 11 | 12 | Next, create a first node and set some attributes: 13 | 14 | ```java 15 | Node sensor0 = g.newNode(0, 0); // for now, use 0,0 as params 16 | sensor0.set("id", "4494F"); 17 | sensor0.set("name", "sensor0"); 18 | ``` 19 | 20 | Then, create a second node and connect the two nodes with a relation 21 | 22 | ```java 23 | Node room0 = g.newNode(0, 0); // for now, use 0,0 as params 24 | room0.set("name", "room0"); 25 | room0.add("sensors", sensor0); 26 | ``` 27 | 28 | Finally, relations can be traversed as follows 29 | 30 | ```java 31 | room0.rel("sensors", (Node[] sensors) -> { //iterate over saved sensors 32 | System.out.println("Sensors"); 33 | for (int i = 0; i < sensors.length; i++) { 34 | System.out.println("\t" + sensors[i].toString()); 35 | } 36 | }); 37 | ``` 38 | 39 | Note that graph processing and traversing is fully asynchronous. 40 | -------------------------------------------------------------------------------- /doc/start/persistence.md: -------------------------------------------------------------------------------- 1 | # Persistence 2 | 3 | MWG comes with a built-in persistence mechanism. Nodes and relationships are automatically serialized and unserialized by MWG and can be stored in different key/value stores. The following example shows how MWG is configured to use Google's LevelDB as a storage backend. 4 | 5 | ```java 6 | Graph g = new GraphBuilder() 7 | .withMemorySize(10000) //cache size before sync to disk 8 | .withStorage(new LevelDBStorage("mwg_db")) 9 | .build(); 10 | 11 | g.connect(isConnected -> { 12 | Node sensor = g.newNode(0, System.currentTimeMillis()); //create a new node for world 0 and time 0 13 | sensor.set("id", Math.abs(rand.nextInt())); 14 | sensor.set("value", rand.nextInt()); 15 | g.index("sensors", sensor, "id", res -> { 16 | g.save(saveResult -> { 17 | g.findAll(0, System.currentTimeMillis(), "sensors", allSensorsNow -> { 18 | System.out.println("All sensors indexed:"); 19 | for (Node sensorNow : allSensorsNow) { 20 | System.out.println("\t" + sensorNow.toString()); 21 | } 22 | }); 23 | }); 24 | }); 25 | }); 26 | ``` -------------------------------------------------------------------------------- /doc/start/temporal_graph.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/start/temporal_graph.graffle -------------------------------------------------------------------------------- /doc/start/temporal_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/start/temporal_graph.png -------------------------------------------------------------------------------- /doc/tasks/Context.md: -------------------------------------------------------------------------------- 1 | # Context and Variables 2 | 3 | In a nutshell, tasks are a chain of reusable actions that manipulate result and variables stored in a context. Such task context is accessible in some specific action where developers have the freedom to access and read current result and variables. 4 | -------------------------------------------------------------------------------- /doc/tasks/Execute.md: -------------------------------------------------------------------------------- 1 | # Task execution methods 2 | 3 | A task is a prototype of execution that can be defined statically and independently to any graph instances. 4 | A task is executed ON a graph. 5 | The simplest API to do so is the following: 6 | 7 | ``` java 8 | task.execute(graph, null); 9 | ``` 10 | 11 | If the task aims at returning a result, then the last task context result will be returned in a result callback passed as parameter. 12 | This callback should be of the type of Callback. 13 | 14 | Such as: 15 | 16 | ``` java 17 | task.execute(graph, (result)-> { 18 | //DO something 19 | if(result != null){ 20 | //you are responsible to free the result set! 21 | result.free(); 22 | } 23 | }); 24 | ``` 25 | 26 | > WARNING: if the callback is not null, you are responsible to free the result, cache full error will occurs otherwise. 27 | -------------------------------------------------------------------------------- /doc/tasks/Hook.md: -------------------------------------------------------------------------------- 1 | # Task hook and Debug modes 2 | 3 | The task execution engine offers various hooks to intercept the execution flow for debugging or printing purposes. Task hooks can be injected either locally (for a particular task) or globally for the graph (for debugging purposes). 4 | 5 | A sample plugin is present in the Core as an example of a global task Hook. 6 | Therefore it is possible to execute all tasks in verbose mode using the following Graph Builder configuration. 7 | 8 | ``` java 9 | Graph g = new GraphBuilder() 10 | .withMemorySize(10000) 11 | .withPlugin(new org.mwg.utility.VerbosePlugin()) 12 | .build(); 13 | ``` 14 | -------------------------------------------------------------------------------- /doc/tasks/Query.md: -------------------------------------------------------------------------------- 1 | # Query Building -------------------------------------------------------------------------------- /doc/tasks/actions/README.md: -------------------------------------------------------------------------------- 1 | # Core Task Actions 2 | The MWG task api is extensible by plugins. For instance, the importer plugin defines dedicated tasks for the manipulation of various format such as CSV. 3 | However, hereafter is detailled the set of tasks proposed by default in MWG core module. 4 | 5 | - [add](add.md) 6 | - [addTo](addTo.md) 7 | - [asVar](asVar.md) 8 | - [asGlobalVar](asGlobalVar.md) 9 | - [fromIndex](fromIndex.md) 10 | - [fromIndexAll](fromIndexAll.md) 11 | - [get](get.md) 12 | - [indexNode](indexNode.md) 13 | - [loop](loop.md) 14 | - [loopPar](loopPar.md) 15 | - [setProperty](setProperty.md) 16 | - [traverse](traverse.md) 17 | - todo.... -------------------------------------------------------------------------------- /doc/tasks/actions/add.md: -------------------------------------------------------------------------------- 1 | # Task Action: Add 2 | 3 | The add action allows to add a unidirectional relation from node(s) in the result to node(s) stored in a variable. 4 | 5 | This action should only be used after a task returning node(s) as result. 6 | 7 | > The use of *add* doesn't impact the current result. 8 | 9 | Therefore, we could modify the running example to add a relation from sensors nodes to rooms nodes: 10 | 11 | ``` java 12 | loop("1","2", 13 | newNode() 14 | .setProperty("name", Type.STRING, "room_{{i}}") 15 | .indexNode("rooms", "name") 16 | .asVar("parentRoom") 17 | .loop("1","3", 18 | newNode() 19 | .setProperty("sensor", Type.STRING, "sensor_{{i}}") 20 | .addTo("sensors", "parentRoom") 21 | .add("room","parentRoom") //Change here !!! 22 | ) 23 | ).execute(g, null); 24 | ``` 25 | 26 | The opposite operation (from variable node(s) to result node(s)) can be done using the [addTo](addTo.md) task. 27 | 28 | 29 | 30 | > Similar to [setProperty](setProperty.md), when several nodes are present in the result, the add task is applied to all of them. 31 | 32 | > If the relation wasn't existing before, a new one is created, otherwise node(s) are just added to the relation. -------------------------------------------------------------------------------- /doc/tasks/actions/addTo.md: -------------------------------------------------------------------------------- 1 | # Task Action: Add To 2 | 3 | The addTo action allows to add a unidirectional relation from node(s) stored in variable to the result node(s). 4 | 5 | This action should only be used after a task returning node(s) as result. 6 | 7 | > The use of *addTo* doesn't impact the current result. 8 | 9 | The addTo action is used in the running example to add a relation from rooms to the newly created sensors. 10 | 11 | ``` java 12 | loop("1","2", 13 | newNode() 14 | .setProperty("name", Type.STRING, "room_{{i}}") 15 | .indexNode("rooms", "name") 16 | .asVar("parentRoom") 17 | .loop("1","3", 18 | newNode() 19 | .setProperty("sensor", Type.STRING, "sensor_{{i}}") 20 | .addTo("sensors", "parentRoom") 21 | ) 22 | ).execute(g, null); 23 | ``` 24 | 25 | In this example, "sensors" is the name of the relation, and "parentRoom" the variable in which node(s) from which the relation will start are stored. 26 | 27 | The opposite operation (from result node(s) to variable node(s)) can be done using the [add](add.md) task. 28 | 29 | > Similar to [setProperty](setProperty.md), when several nodes are present in the result, the add task is applied to all of them. 30 | 31 | > If the relation wasn't existing before, a new one is created, otherwise node(s) are just added to the relation. -------------------------------------------------------------------------------- /doc/tasks/actions/asGlobalVar.md: -------------------------------------------------------------------------------- 1 | # Task Action: As Global Var 2 | 3 | The asGlobalVar action allows to store the current result in a global variable. If a variable of this name was already existing, then the variable is overwritten. 4 | 5 | This action can be used after any task, and will work on any current result. 6 | 7 | > The use of *asGlobalVar* doesn't impact the current result. 8 | 9 | > The defined variable will be accessible made accessible to all tasks. 10 | 11 | The following expression applied after the running example : 12 | 13 | ```java 14 | inject(0) 15 | .asGlobalVar("counter") 16 | .fromIndexAll("rooms") 17 | .foreach( 18 | traverse("sensors") 19 | .foreach( 20 | math("counter+1") 21 | .asGlobalVar("counter") 22 | ) 23 | ) 24 | .print("{{counter}}") 25 | .execute(g, null); 26 | ``` 27 | 28 | will print the following result: 29 | 30 | ``` 31 | 6.0 32 | ``` 33 | 34 | Related action are [asVar](asVar.md) that will store the current result in the upper possible context containing a variable with this name, and [defineVar](defineVar.md) that will add the variable to the current context only without modifying the father context . 35 | -------------------------------------------------------------------------------- /doc/tasks/actions/asVar.md: -------------------------------------------------------------------------------- 1 | # Task Action: As Var 2 | 3 | The asVar action allows to store the current result in a variable. 4 | If a variable of this name already exists in the parent context, it will be updated and thus any task that were using this variable will use the new value. 5 | if the variable wasn't existing, the variable is created and only task from the same scope will be able to access the variable 6 | 7 | This action can be used after any task, and will work on any current result. 8 | 9 | > The use of *asVar* doesn't impact the current result. 10 | 11 | > The variable will be accessible 12 | 13 | 14 | The asVar action can be used to exit a while loop for example: 15 | 16 | 17 | ``` java 18 | inject(1) 19 | .asVar("it") 20 | .print("{{it}}") 21 | .whileDo( cond("it<4"), 22 | math("it+1") 23 | .asVar("it") 24 | .print("{{it}}")) 25 | .execute(g, null); 26 | ``` 27 | 28 | This code will produce the following output: 29 | 30 | ``` 31 | 1 32 | 2.0 33 | 3.0 34 | 4.0 35 | ``` 36 | 37 | Related action are [asGlobalVar](asGlobalVar.md) that will store the current result in a global Variable and [defineVariable](defineVariable.md) that define a variable in the current scope and variable with the same name in parent context will not be impacted. 38 | -------------------------------------------------------------------------------- /doc/tasks/actions/fromIndex.md: -------------------------------------------------------------------------------- 1 | # Task Action: From Index 2 | 3 | The fromIndex action retrieves a globally indexed node, i.e., accessible as an entry point of the graph, given its indexing property and the name of the indexing relation. 4 | 5 | > See the [indexNode action](indexNode.md) to get information on how to index nodes in such a way. 6 | 7 | > The result of the *from Index* will be put in the result and made accessible to the next Task. 8 | 9 | This action can be executed at any moment and doesn't require previous result. 10 | 11 | The first argument of this action is the name of the indexing relation, and the second is the query on the indexing property to make. 12 | 13 | > See the [query](../Query.md) to get information on how to build queries. 14 | 15 | Therefore, the following code run after the running example: 16 | 17 | ``` java 18 | fromIndex("rooms","name=room_1") 19 | .get("name") 20 | .print("{{result}}") 21 | .execute(g, null); 22 | ``` 23 | 24 | will return: 25 | 26 | ``` 27 | room_1 28 | ``` 29 | 30 | 31 | > See [fromIndexAll action](fromIndexAll.md), to get information on how to retrieve all nodes indexed with a given relation name without filter. -------------------------------------------------------------------------------- /doc/tasks/actions/fromIndexAll.md: -------------------------------------------------------------------------------- 1 | # Task Action: From Index All 2 | 3 | The fromIndexAll action retrieves all nodes that were indexed globally, i.e., accessible as an entry point of the graph, 4 | using a specified indexing name. 5 | 6 | > See the [indexNode action](indexNode.md) to get information on how to index nodes in such a way. 7 | 8 | > The result of the *from Index all* will be put in the result and made accessible to the next Task. 9 | 10 | This action can be executed at any moment and doesn't require previous result. 11 | 12 | 13 | Therefore, the following code run after the running example: 14 | 15 | ``` java 16 | fromIndexAll("rooms") 17 | .get("name") 18 | .print("{{result}}") 19 | .execute(g, null); 20 | ``` 21 | 22 | will return: 23 | 24 | ``` 25 | [room_1,room_2] 26 | ``` 27 | 28 | > See [fromIndex action](fromIndex.md), to get information on how to retrieve a specific globally indexed node. -------------------------------------------------------------------------------- /doc/tasks/actions/get.md: -------------------------------------------------------------------------------- 1 | # Task Action: Get 2 | 3 | The get action allows to get the value(s) of a node property. The property can be of any type, a relation, a map or a primitive Type. 4 | See also [setProperty](setProperty.md) to discover how to set a property of a node using Tasks. 5 | 6 | This action should only be used after a task returning node(s) as result. 7 | 8 | > The result of the *get* will be put in the result and made accessible to the next Task. 9 | 10 | Therefore, the following expression: 11 | 12 | ```java 13 | newNode() 14 | .setProperty("name","mynode") 15 | .get("name") 16 | .print("{{result}}" 17 | .execute(g,null); 18 | ``` 19 | 20 | Will print the following output in console: 21 | 22 | ``` 23 | mynode 24 | ``` 25 | 26 | 27 | > If the goal is to retrieve and work on the node(s) linked to the current node by a relation, the [traverse](traverse.md) Task should be considered to have safely only nodes in the result. 28 | 29 | ## Multiple Nodes get 30 | 31 | When several nodes are present in the result, the get task is applied to all of them and results are stored in an array. 32 | 33 | The following expression : 34 | 35 | ```java 36 | fromIndexAll("rooms") 37 | .get("locked") 38 | .print("{{result}}") 39 | .execute(g,null); 40 | ``` 41 | 42 | will print the following output when executed after the one presented at the end of [setProperty](setProperty.md): 43 | 44 | ``` 45 | [true,true] 46 | ``` 47 | 48 | -------------------------------------------------------------------------------- /doc/tasks/actions/indexNode.md: -------------------------------------------------------------------------------- 1 | ## Task Action: indexNode -------------------------------------------------------------------------------- /doc/tasks/actions/localIndex.md: -------------------------------------------------------------------------------- 1 | ## Task Action: LocalIndex 2 | 3 | The `localIndex` action allows to create an/add to an existing indexed relation from node(s) in the result to node(s) stored in a variable. 4 | 5 | This action should only be used after a task returning node(s) as result. 6 | 7 | > The use of *localIndex* doesn't impact the current result. 8 | 9 | Therefore, we could modify the running example to add an indexed relation from sensor nodes to room nodes: 10 | 11 | ``` java 12 | loop("1","2", 13 | newNode() 14 | .setProperty("name", Type.STRING, "room_{{i}}") 15 | .indexNode("rooms", "name") 16 | .asVar("parentRoom") 17 | .loop("1","3", 18 | newNode() 19 | .setProperty("sensor", Type.STRING, "sensor_{{i}}") 20 | .addTo("sensors", "parentRoom") 21 | .localIndex("indexedRoom","room","parentRoom") //Change here !!! 22 | ) 23 | ).execute(g, null); 24 | ``` 25 | 26 | To undo this operation, use [localUnindex](localUnindex.md) task. 27 | 28 | > Similar to [add](add.md), but with an indexing concept. 29 | 30 | > If the relation wasn't existing before, a new one is created, otherwise node(s) are just added to the relation. -------------------------------------------------------------------------------- /doc/tasks/actions/localUnindex.md: -------------------------------------------------------------------------------- 1 | ## Task Action: LocalUnindex 2 | 3 | The `localUnindex` action allows to remove node(s) in an existing indexed relation of node(s) in the result. 4 | 5 | This action should only be used after a task returning node(s) as result. 6 | 7 | > The use of *localUnindex* doesn't impact the current result. 8 | 9 | Therefore, we could modify the running example to add an indexed relation from sensor nodes to room nodes: 10 | 11 | ``` java 12 | loop("1","2", 13 | newNode() 14 | .setProperty("name", Type.STRING, "room_{{i}}") 15 | .indexNode("rooms", "name") 16 | .asVar("parentRoom") 17 | .loop("1","3", 18 | newNode() 19 | .setProperty("sensor", Type.STRING, "sensor_{{i}}") 20 | .addTo("sensors", "parentRoom") 21 | .localIndex("idxParentRoom","room","parentRoom") //Change here !!! 22 | ) 23 | ).execute(g, null); 24 | 25 | [...] 26 | 27 | fromIndexAll("rooms") 28 | .localUnindex("idxParentRoom","room","parentRoom") 29 | .execute(g, null); 30 | ``` 31 | 32 | 33 | The opposite operation is to create or modify a local index with [localIndex](localIndex.md) task. 34 | 35 | > Similar to [remove](remove.md), but with an indexing concept. -------------------------------------------------------------------------------- /doc/tasks/actions/loop.md: -------------------------------------------------------------------------------- 1 | # Task Action: Loop 2 | 3 | The loop action allows to express the repetition of a sub Task passed as a parameter. Similarly to **for** loop construction in many imperative language, this action express the iteration over a range, through **INCLUSIVE** boundaries. 4 | 5 | > Additionally the loop action declares automatically a **i** variable containing the current loop index. 6 | 7 | Therefore the following expression: 8 | 9 | ```java 10 | loop("0", "3", 11 | newNode() 12 | .setProperty("name", Type.STRING, "node_{{i}}") 13 | .print("{{result}}") 14 | ) 15 | .execute(g,null); 16 | ``` 17 | 18 | Will print the following output in console: 19 | 20 | ``` 21 | {"world":0,"time":0,"id":1,"name":"node_0"} 22 | {"world":0,"time":0,"id":2,"name":"node_1"} 23 | {"world":0,"time":0,"id":3,"name":"node_2"} 24 | {"world":0,"time":0,"id":4,"name":"node_3"} 25 | ``` 26 | 27 | In addition, loop action parameters are templates and can express math expression such as ```"{{=3-1}}"``` therefore, exclusive bounds can be build this way. 28 | 29 | Finally, the loop action is transient and will not modify the current context. Therefore, the task context after the loop action remains unchanged. If a cumulative result has to be built, the best is to use a **addToVariable** action within the repeated sub task. 30 | 31 | 32 | -------------------------------------------------------------------------------- /doc/tasks/actions/loopPar.md: -------------------------------------------------------------------------------- 1 | # Task Action: LoopPar 2 | 3 | The loopPar action is similar than [loop](loop.md) action with the ability to leverage multi-core infrastructure. 4 | Therefore the subTask of the loopPar action will be executed in CONCURRENCE. 5 | 6 | > WARNING: to avoid variable conflict during parallel execution, we encourage users to use defineVar methods to ensure variable scopes. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doc/tasks/actions/propertiesNames.md: -------------------------------------------------------------------------------- 1 | # Task Action: propertiesNames 2 | The `propertiesNames` action allows to get all the property names of node(s) in the result. 3 | This action should only be used after a task returning node(s) as result. 4 | 5 | The next result will be a array of all the properties names. 6 | 7 | If you want to get specific type, you can use [propertiesNamesWithTypes](propertiesNamesWithTypes.md) -------------------------------------------------------------------------------- /doc/tasks/actions/propertiesNamesWithTypes.md: -------------------------------------------------------------------------------- 1 | # Task Action: propertiesNamesWithTypes 2 | The `propertiesNamesWithTypes` action allows to get all the propertiesNamesWithTypes names of node(s) in the result, and filter the result with the given types. 3 | This action should only be used after a task returning node(s) as result. 4 | 5 | The next result will be an array of all the properties names. 6 | 7 | The parameter is a flat string with the types values, separated by a comma. 8 | The available mwg types are present in `org.mwg.Type`. 9 | 10 | If you want to get all the properties, please see [propertiesNames](propertiesNames.md) -------------------------------------------------------------------------------- /doc/tasks/actions/traverse.md: -------------------------------------------------------------------------------- 1 | # Task Action: Traverse 2 | 3 | The traverse action allows to traverse relations of one or more nodes. 4 | 5 | This action should only be used after a task returning node(s) as a result. 6 | 7 | > traverse action will put all the nodes from the given relation of a node in the results 8 | 9 | > If several nodes are in the result, the result is the aggregation of the traverse action results on each one of the nodes (in the order of the nodes). 10 | It should be noted that the information of which nodes are coming from which nodes relation is lost. 11 | 12 | 13 | > No deduplication is done, thus nodes present several times in a relation or in several node relations in the result will appear several times in the result. 14 | 15 | 16 | 17 | Therefore, using the running example as a base, the execution of the following code: 18 | 19 | ``` java 20 | 21 | fromIndexAll("rooms") 22 | .traverse("sensors") 23 | .get("sensor") 24 | .print("{{result}}") 25 | .execute(g, null); 26 | 27 | ``` 28 | 29 | will print the following: 30 | 31 | ``` 32 | [sensor_1,sensor_2,sensor_3,sensor_1,sensor_2,sensor_3] 33 | ``` 34 | 35 | Which corresponds to all the sensors names that were declared. 36 | 37 | 38 | > See [get Action](get.md), to get information on the behavior of the get action. 39 | 40 | -------------------------------------------------------------------------------- /doc/tasks/running_example.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/tasks/running_example.graffle -------------------------------------------------------------------------------- /doc/tasks/running_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/doc/tasks/running_example.png -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2017 The MWG Authors. All rights reserved. 4 | #

5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | #

9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | #

11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | mvn clean install -------------------------------------------------------------------------------- /plugins/README.md: -------------------------------------------------------------------------------- 1 | # mwDB plugins 2 | 3 | ### Storage plugins 4 | 5 | - **LevelDB:** embedded mono-computer storage, lightweight and efficient to terra-bytes 6 | - **RocksDB:** embedded mono-computer storage, lightweight and efficient to terra-bytes, forked from LevelDB to handle better concurrency 7 | 8 | ### Machine Learning Plugin 9 | 10 | This plugins contains all machine learning algorithms to enable live analytics on top of Many World Graphs. 11 | 12 | ### CSV Importer 13 | 14 | Defines a scalable importer for legacy CSV files 15 | 16 | -------------------------------------------------------------------------------- /plugins/benchmark/data/1.json: -------------------------------------------------------------------------------- 1 | {"benchmarks":[{"benchmark":"NoopCallback_heap","metrics":[{"name":"temporalInsert","value":373412.9947722181},{"name":"temporalRead","value":902527.0758122742},{"name":"temporalTraverseThenRead","value":902527.0758122742}]},{"benchmark":"TrampolineCallback_heap","metrics":[{"name":"temporalInsert","value":529380.6246691371},{"name":"temporalRead","value":883392.22614841},{"name":"temporalTraverseThenRead","value":479846.4491362764}]},{"benchmark":"TrampolineTask_heap","metrics":[{"name":"temporalInsert","value":298418.38257236645},{"name":"temporalRead","value":438404.2086804033},{"name":"temporalTraverseThenRead","value":361402.2406938923}]},{"benchmark":"NoopCallback_offheap","metrics":[{"name":"temporalInsert","value":44381.32433871827},{"name":"temporalRead","value":268672.75658248254},{"name":"temporalTraverseThenRead","value":268672.75658248254}]},{"benchmark":"TrampolineCallback_offheap","metrics":[{"name":"temporalInsert","value":44704.725289463095},{"name":"temporalRead","value":258264.46280991737},{"name":"temporalTraverseThenRead","value":141823.85477237272}]},{"benchmark":"TrampolineTask_offheap","metrics":[{"name":"temporalInsert","value":40706.66775217781},{"name":"temporalRead","value":160359.2046183451},{"name":"temporalTraverseThenRead","value":87206.76724513822}]}],"time":1482055536934} 2 | -------------------------------------------------------------------------------- /plugins/benchmark/data/2.json: -------------------------------------------------------------------------------- 1 | {"benchmarks":[{"benchmark":"NoopCallback_heap","metrics":[{"name":"temporalInsert","value":353857.0417551309},{"name":"temporalRead","value":925069.3802035153},{"name":"temporalTraverseThenRead","value":925069.3802035153}]},{"benchmark":"TrampolineCallback_heap","metrics":[{"name":"temporalInsert","value":511508.9514066496},{"name":"temporalRead","value":887311.4463176575},{"name":"temporalTraverseThenRead","value":485201.358563804}]},{"benchmark":"TrampolineTask_heap","metrics":[{"name":"temporalInsert","value":303490.13657056144},{"name":"temporalRead","value":471031.5591144606},{"name":"temporalTraverseThenRead","value":357015.35166012135}]},{"benchmark":"NoopCallback_offheap","metrics":[{"name":"temporalInsert","value":48923.67906066536},{"name":"temporalRead","value":244200.24420024423},{"name":"temporalTraverseThenRead","value":244200.24420024423}]},{"benchmark":"TrampolineCallback_offheap","metrics":[{"name":"temporalInsert","value":44893.37822671156},{"name":"temporalRead","value":240500.24050024047},{"name":"temporalTraverseThenRead","value":132625.99469496022}]},{"benchmark":"TrampolineTask_offheap","metrics":[{"name":"temporalInsert","value":39560.09177941293},{"name":"temporalRead","value":144738.74656245476},{"name":"temporalTraverseThenRead","value":91382.61902586129}]}],"time":1482055719790} 2 | -------------------------------------------------------------------------------- /plugins/benchmark/src/main/java/org/mwg/benchmark/JsonHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.benchmark; 17 | 18 | import com.eclipsesource.json.JsonArray; 19 | 20 | public class JsonHandler { 21 | 22 | public static final JsonArray global = new JsonArray(); 23 | 24 | public static final String METRIC_TEMPORAL_INSERT = "temporalInsert"; 25 | 26 | public static final String METRIC_TEMPORAL_READ = "temporalRead"; 27 | 28 | public static final String METRIC_TEMPORAL_TRAVERSE_THEN_READ = "temporalTraverseThenRead"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /plugins/debug/src/main/java/org/mwg/debug/TaskTraceRegistry.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.debug; 17 | 18 | import java.util.HashMap; 19 | import java.util.Map; 20 | 21 | public class TaskTraceRegistry { 22 | 23 | public final Map tasks = new HashMap(); 24 | public final Map contexts = new HashMap(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /plugins/debug/src/test/java/org/mwg/debug/TaskServerPluginTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.debug; 17 | 18 | import org.mwg.Graph; 19 | import org.mwg.GraphBuilder; 20 | import org.mwg.Type; 21 | 22 | import static org.mwg.task.Actions.newNode; 23 | 24 | public class TaskServerPluginTest { 25 | 26 | public static void main(String[] args) { 27 | Graph g = new GraphBuilder().withPlugin(new TaskServerPlugin(8077)).build(); 28 | g.connect(result -> { 29 | 30 | newNode().setProperty("name", Type.STRING, "hello").execute(g, null); 31 | 32 | //g.disconnect(null); 33 | }); 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /plugins/importer/README.md: -------------------------------------------------------------------------------- 1 | # mwDB CSV Importer plugin 2 | 3 | Many DataSets are already recorded and stored as simple CSV files. 4 | This plugins implements a scalable Java import to inject these data direct in a mwDB graph. 5 | This importer plugin can serve various purposes, such as interconnection with legacy systems or simply analytics experiments on top of publicly available datasets. 6 | The CSVImporter implements a data Mapper that can on-the-fly align CSV data with desired schema in the graph. 7 | Finally the plugin is extensible, by allowing users to define their own method to map data to inject to KGraph nodes. 8 | 9 | ## Usage 10 | 11 | More to come... 12 | Right now tests are implemented in a way to illustrate the various usage of the API on publicly available datasets. 13 | Have a look to start using CSV Importer -------------------------------------------------------------------------------- /plugins/importer/src/test/resources/activity/OrdonezA_Description.txt: -------------------------------------------------------------------------------- 1 | ============================= 2 | OrdonezA DATASET DESCRIPTION 3 | ============================= 4 | 5 | Home setting: 4 rooms house 6 | Number of labelled days: 14 days 7 | Labels (ADLs included): Leaving, Toileting, Showering, Sleeping, Breakfast, Lunch, Dinner, Snack, Spare_Time/TV, Grooming 8 | Number of sensors: 12 sensors 9 | Sensors: PIR: Shower, Basin, Cooktop 10 | Magnetic: Maindoor, Fridge, Cabinet, Cupboard 11 | Flush: Toilet 12 | Pressure: Seat, Bed 13 | Electric: Microwave, Toaster -------------------------------------------------------------------------------- /plugins/importer/src/test/resources/activity/OrdonezB_Description.txt: -------------------------------------------------------------------------------- 1 | ============================= 2 | OrdonezB DATASET DESCRIPTION 3 | ============================= 4 | Home setting: 5 rooms house 5 | Number of labelled days: 21 days 6 | Labels (ADLs included): Leaving, Toileting, Showering, Sleeping, Breakfast, Lunch, Dinner, Snack, Spare_Time/TV, Grooming 7 | Number of sensors: 12 sensors 8 | Sensors: PIR: Shower, Basin, Door Kitchen, Door Bathroom, Door Bedroom 9 | Magnetic: Maindoor, Fridge, Cupboard 10 | Flush: Toilet 11 | Pressure: Seat, Bed 12 | Electric: Microwave -------------------------------------------------------------------------------- /plugins/importer/src/test/resources/activity/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/plugins/importer/src/test/resources/activity/README.txt -------------------------------------------------------------------------------- /plugins/importer/src/test/resources/activity/readme.md: -------------------------------------------------------------------------------- 1 | DataSet is publicly available at the following address: 2 | 3 | https://archive.ics.uci.edu/ml/datasets/Activities+of+Daily+Living+%28ADLs%29+Recognition+Using+Binary+Sensors -------------------------------------------------------------------------------- /plugins/importer/src/test/resources/folder with spaces in name/aFile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/plugins/importer/src/test/resources/folder with spaces in name/aFile.txt -------------------------------------------------------------------------------- /plugins/importer/src/test/resources/readme.md: -------------------------------------------------------------------------------- 1 | # Various DataSets to enable CSV importer tests -------------------------------------------------------------------------------- /plugins/importer/src/test/resources/smarthome/readme.md: -------------------------------------------------------------------------------- 1 | DataSet is publicly available at the following address: 2 | 3 | https://archive.ics.uci.edu/ml/datasets/SML2010# -------------------------------------------------------------------------------- /plugins/importer/src/test/resources/smarthome/smarthome_mini_1.T15.txt: -------------------------------------------------------------------------------- 1 | 1:Date 2:Time 3:Temperature_Comedor_Sensor 4:Temperature_Habitacion_Sensor 5:Weather_Temperature 6:CO2_Comedor_Sensor 7:CO2_Habitacion_Sensor 8:Humedad_Comedor_Sensor 9:Humedad_Habitacion_Sensor 10:Lighting_Comedor_Sensor 11:Lighting_Habitacion_Sensor 12:Precipitacion 13:Meteo_Exterior_Crepusculo 14:Meteo_Exterior_Viento 15:Meteo_Exterior_Sol_Oest 16:Meteo_Exterior_Sol_Est 17:Meteo_Exterior_Sol_Sud 18:Meteo_Exterior_Piranometro 19:Exterior_Entalpic_1 20:Exterior_Entalpic_2 21:Exterior_Entalpic_turbo 22:Temperature_Exterior_Sensor 23:Humedad_Exterior_Sensor 24:Day_Of_Week 2 | 13/03/2012 11:45 18.1875 17.8275 0 216.56 221.92 39.9125 42.415 81.665 113.52 0 623.36 1.42625 9690.24 12604.2 95436.8 758.88 0 0 0 18.115 48.375 2 3 | 13/03/2012 12:00 18.4633 18.1207 6.8 219.947 220.363 39.9267 42.2453 81.7413 113.605 0 623.211 1.592 11022 10787.2 95436.8 762.069 0 0 0 18.4147 47.808 2 4 | 13/03/2012 12:15 18.7673 18.4367 17 219.403 218.933 39.772 42.2267 81.424 113.6 0 622.656 1.89133 13960.5 9669.63 95398.6 766.251 0 0 0 18.8533 47.432 2 5 | -------------------------------------------------------------------------------- /plugins/importer/src/test/resources/smartmeters/readme.md: -------------------------------------------------------------------------------- 1 | DataSet is publicly available at the following address: 2 | 3 | http://archive.ics.uci.edu/ml/datasets/Individual+household+electric+power+consumption 4 | -------------------------------------------------------------------------------- /plugins/memory/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | -------------------------------------------------------------------------------- /plugins/memory/src/main/java/org/mwg/memory/offheap/OffHeapConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import java.util.HashMap; 19 | import java.util.Map; 20 | 21 | public class OffHeapConstants { 22 | 23 | public static final int NULL_PTR = -1; 24 | 25 | //TODO remove this before release 26 | public static boolean DEBUG_MODE = true; 27 | public static final Map SEGMENTS = new HashMap(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /plugins/memory/src/main/java/org/mwg/memory/offheap/OffHeapContainer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | public interface OffHeapContainer { 19 | 20 | long addrByIndex(long elemIndex); 21 | 22 | void setAddrByIndex(long elemIndex, long newAddr); 23 | 24 | void lock(); 25 | 26 | void unlock(); 27 | 28 | void declareDirty(); 29 | } 30 | -------------------------------------------------------------------------------- /plugins/memory/src/main/java/org/mwg/memory/offheap/OffHeapMemoryFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.mwg.Graph; 19 | import org.mwg.chunk.ChunkSpace; 20 | import org.mwg.plugin.MemoryFactory; 21 | import org.mwg.struct.Buffer; 22 | 23 | public class OffHeapMemoryFactory implements MemoryFactory { 24 | 25 | @Override 26 | public final ChunkSpace newSpace(final long memorySize, final Graph graph, boolean deepWorld) { 27 | return new OffHeapChunkSpace(memorySize, graph); 28 | } 29 | 30 | @Override 31 | public final Buffer newBuffer() { 32 | return new OffHeapBuffer(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/main/java/org/mwg/memory/offheap/OffHeapMemoryPlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.mwg.Graph; 19 | import org.mwg.plugin.Plugin; 20 | 21 | public class OffHeapMemoryPlugin implements Plugin { 22 | 23 | @Override 24 | public void start(Graph graph) { 25 | graph.setMemoryFactory(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @Override 29 | public void stop() { 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapBufferTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.memory.AbstractBufferTest; 21 | 22 | public class OffHeapBufferTest extends AbstractBufferTest { 23 | 24 | public OffHeapBufferTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(),0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapChunkSpaceTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractChunkSpaceTest; 21 | 22 | public class OffHeapChunkSpaceTest extends AbstractChunkSpaceTest { 23 | 24 | public OffHeapChunkSpaceTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(),0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapDMatrixTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractMatrixTest; 21 | 22 | public class OffHeapDMatrixTest extends AbstractMatrixTest { 23 | 24 | public OffHeapDMatrixTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(), 0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapEGraphTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractEGraphTest; 21 | 22 | public class OffHeapEGraphTest extends AbstractEGraphTest { 23 | 24 | public OffHeapEGraphTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(), 0); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapFixedStackTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.Assert; 19 | import org.junit.Test; 20 | import org.mwg.chunk.Stack; 21 | import org.mwg.internal.chunk.AbstractFixedStackTest; 22 | 23 | public class OffHeapFixedStackTest extends AbstractFixedStackTest { 24 | 25 | @Test 26 | public void offHeapFixedStackTest() { 27 | Stack stack = new OffHeapFixedStack(CAPACITY, true); 28 | test(stack); 29 | stack.free(); 30 | 31 | if (OffHeapConstants.DEBUG_MODE) { 32 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(), 0); 33 | } 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapGenChunkTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractGenChunkTest; 21 | 22 | public class OffHeapGenChunkTest extends AbstractGenChunkTest { 23 | 24 | public OffHeapGenChunkTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(),0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapLongLongArrayMapTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractLongLongArrayMapTest; 21 | 22 | public class OffHeapLongLongArrayMapTest extends AbstractLongLongArrayMapTest { 23 | 24 | public OffHeapLongLongArrayMapTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(),0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapLongLongMapTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractLongLongMapTest; 21 | 22 | public class OffHeapLongLongMapTest extends AbstractLongLongMapTest { 23 | 24 | public OffHeapLongLongMapTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(),0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapRelationTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractRelationTest; 21 | 22 | public class OffHeapRelationTest extends AbstractRelationTest { 23 | 24 | public OffHeapRelationTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(),0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapStateChunkTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractStateChunkTest; 21 | 22 | public class OffHeapStateChunkTest extends AbstractStateChunkTest { 23 | 24 | public OffHeapStateChunkTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(),0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapStringIntMapTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractStringIntMapTest; 21 | 22 | public class OffHeapStringIntMapTest extends AbstractStringIntMapTest { 23 | 24 | public OffHeapStringIntMapTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(), 0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapTimeTreeChunkTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractTimeTreeTest; 21 | 22 | public class OffHeapTimeTreeChunkTest extends AbstractTimeTreeTest { 23 | 24 | public OffHeapTimeTreeChunkTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(),0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/memory/src/test/java/org/mwg/memory/offheap/OffHeapWorldOrderChunkTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.memory.offheap; 17 | 18 | import org.junit.After; 19 | import org.junit.Assert; 20 | import org.mwg.internal.chunk.AbstractWorldOrderChunkTest; 21 | 22 | public class OffHeapWorldOrderChunkTest extends AbstractWorldOrderChunkTest { 23 | 24 | public OffHeapWorldOrderChunkTest() { 25 | super(new OffHeapMemoryFactory()); 26 | } 27 | 28 | @After 29 | public void tearDown() throws Exception { 30 | if (OffHeapConstants.DEBUG_MODE) { 31 | Assert.assertEquals(OffHeapConstants.SEGMENTS.size(),0); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /plugins/ml/src/main/java/org/mwg/ml/ProgressReporter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.ml; 17 | 18 | public interface ProgressReporter { 19 | void updateProgress(int value); 20 | boolean isCancelled(); 21 | void updateInformation(String info); 22 | } 23 | -------------------------------------------------------------------------------- /plugins/ml/src/main/java/org/mwg/ml/common/matrix/SVDDecompose.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.ml.common.matrix; 17 | 18 | import org.mwg.struct.DMatrix; 19 | 20 | public interface SVDDecompose { 21 | 22 | SVDDecompose factor(DMatrix A, boolean workInPlace); 23 | 24 | DMatrix getU(); 25 | 26 | DMatrix getVt(); 27 | 28 | double[] getS(); 29 | 30 | DMatrix getSMatrix(); 31 | } 32 | -------------------------------------------------------------------------------- /plugins/ml/src/main/java/org/mwg/ml/common/matrix/TransposeType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.ml.common.matrix; 17 | 18 | public enum TransposeType { 19 | NOTRANSPOSE, TRANSPOSE 20 | } 21 | 22 | -------------------------------------------------------------------------------- /plugins/ml/src/main/java/org/mwg/ml/common/matrix/jamasolver/Utils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.ml.common.matrix.jamasolver; 17 | 18 | class Utils { 19 | 20 | /** 21 | * sqrt(a^2 + b^2) without under/overflow. 22 | **/ 23 | static double hypot(double a, double b) { 24 | double r; 25 | if (Math.abs(a) > Math.abs(b)) { 26 | r = b / a; 27 | r = Math.abs(a) * Math.sqrt(1 + r * r); 28 | } else if (b != 0) { 29 | r = a / b; 30 | r = Math.abs(b) * Math.sqrt(1 + r * r); 31 | } else { 32 | r = 0.0; 33 | } 34 | return r; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /plugins/ml/src/main/java/org/mwg/ml/neuralnet/NeuralFunction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.ml.neuralnet; 17 | 18 | public interface NeuralFunction { 19 | double activate(double x); 20 | double derivate(double x, double fct); 21 | } 22 | -------------------------------------------------------------------------------- /plugins/ml/src/main/java/org/mwg/ml/neuralnet/NeuralNodeType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.ml.neuralnet; 17 | 18 | public class NeuralNodeType { 19 | public static int HIDDEN=0; 20 | public static int INPUT=1; 21 | public static int OUTPUT=2; 22 | public static int ROOT=3; 23 | } 24 | -------------------------------------------------------------------------------- /plugins/ml/src/main/java/org/mwg/ml/neuralnet/functions/LinearFunction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.ml.neuralnet.functions; 17 | 18 | import org.mwg.ml.neuralnet.NeuralFunction; 19 | 20 | public class LinearFunction implements NeuralFunction{ 21 | @Override 22 | public double activate(double x) { 23 | return x; 24 | } 25 | 26 | @Override 27 | public double derivate(double x, double fct) { 28 | return 1; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /plugins/ml/src/main/java/org/mwg/ml/neuralnet/functions/SigmoidFunction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.ml.neuralnet.functions; 17 | 18 | import org.mwg.ml.neuralnet.NeuralFunction; 19 | 20 | public class SigmoidFunction implements NeuralFunction { 21 | @Override 22 | public double activate(double x) { 23 | return 1 / (1 + Math.exp(-x)); 24 | } 25 | 26 | @Override 27 | public double derivate(double x, double fct) { 28 | return fct * (1 - fct); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /plugins/mlext/src/main/java/org/mwg/MLExtPlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg; 17 | 18 | import org.mwg.mlext.NeuralNetAttribute; 19 | import org.mwg.plugin.AbstractPlugin; 20 | 21 | public class MLExtPlugin extends AbstractPlugin { 22 | 23 | public MLExtPlugin() { 24 | declareExternalAttribute("NeuralNetAttribute", () -> new NeuralNetAttribute()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /plugins/model/.gitignore: -------------------------------------------------------------------------------- 1 | mavenplugin/src/main/resources/mwg* 2 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/exemples/hello.mm: -------------------------------------------------------------------------------- 1 | class sample.Cloud { 2 | rel nodes : sample.Node 3 | } 4 | class sample.Node { 5 | att name : String 6 | rel softwares : sample.Software 7 | } 8 | class sample.Software { 9 | att name : String 10 | att size : Integer 11 | } 12 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/exemples/ml_1.mm: -------------------------------------------------------------------------------- 1 | 2 | class Customer { 3 | att name : String 4 | 5 | } 6 | 7 | class smartgrid.SmartMeter { 8 | att activeEnergy : Double 9 | att reactiveEnergy : Double 10 | rel customer : Customer { 11 | with upperBound 3 12 | } 13 | 14 | index customers : Customer { 15 | from name 16 | } 17 | 18 | att isAnomaly : Boolean learnedUsing { 19 | from "this.activeEnergy" 20 | from "reactiveEnery" 21 | from "this.elements.parent" 22 | from "relations.parent.myAtt ^2 + relations.parent.myAtt / 2" 23 | using "GaussianClassifier" 24 | } 25 | 26 | global learned att polynomialAtt : Double { 27 | from "TITI" 28 | from "GIGI" 29 | with precision 0.1 30 | using "PolynomialExtrapolation" 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/KAttribute.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast; 17 | 18 | public interface KAttribute extends KProperty { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/KClass.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast; 17 | 18 | public interface KClass extends KClassifier { 19 | 20 | KProperty[] properties(); 21 | 22 | void addProperty(KProperty property); 23 | 24 | KProperty property(String name); 25 | 26 | KClass parent(); 27 | 28 | void setParent(KClass parent); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/KClassifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast; 17 | 18 | public interface KClassifier { 19 | 20 | String name(); 21 | 22 | String fqn(); 23 | 24 | String pack(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/KDependency.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast; 17 | 18 | 19 | public interface KDependency { 20 | 21 | String query(); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/KEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast; 17 | 18 | public interface KEnum extends KClassifier { 19 | 20 | String[] literals(); 21 | 22 | void addLiteral(String value); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/KIndex.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast; 17 | 18 | public interface KIndex extends KClassifier { 19 | 20 | KProperty[] properties(); 21 | 22 | void addProperty(String value); 23 | 24 | KClass type(); 25 | 26 | } -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/KModel.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast; 17 | 18 | public interface KModel { 19 | 20 | KClassifier[] classifiers(); 21 | 22 | void addClassifier(KClassifier classifier); 23 | 24 | KClassifier get(String fqn); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/KRelation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast; 17 | 18 | public interface KRelation extends KProperty { 19 | } 20 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/impl/Attribute.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast.impl; 17 | 18 | import org.kevoree.modeling.ast.KAttribute; 19 | 20 | public class Attribute extends Property implements KAttribute { 21 | public Attribute(String name, String type) { 22 | super(name, type); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/impl/Dependency.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast.impl; 17 | 18 | import org.kevoree.modeling.ast.KDependency; 19 | 20 | public class Dependency implements KDependency { 21 | 22 | private final String query; 23 | 24 | public Dependency(String query) { 25 | this.query = query; 26 | } 27 | 28 | @Override 29 | public String query() { 30 | return query; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugins/model/dsl/src/main/java/org/kevoree/modeling/ast/impl/Relation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kevoree.modeling.ast.impl; 17 | 18 | import org.kevoree.modeling.ast.KRelation; 19 | 20 | public class Relation extends Property implements KRelation { 21 | public Relation(String name, String type) { 22 | super(name, type); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /plugins/model/generator/src/test/java/org/kmf/generator/GeneratorTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.kmf.generator; 17 | 18 | import org.junit.Test; 19 | 20 | import java.io.File; 21 | 22 | public class GeneratorTest { 23 | 24 | @Test 25 | public void test() throws Exception { 26 | Generator gen = new Generator(); 27 | String resourcesPath = GeneratorTest.class.getClassLoader().getResource(".").getFile(); 28 | gen.scan(new File(resourcesPath)); 29 | gen.generate("sample.Hello", new File(resourcesPath + "/../generated-sources")); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /plugins/model/generator/src/test/resources/hello.mm: -------------------------------------------------------------------------------- 1 | enum hello.SmartMeterState { 2 | InError, Healthy, Pending 3 | } 4 | 5 | index nodes : sample.Node { 6 | name 7 | } 8 | 9 | class sample.Cloud { 10 | rel nodes : sample.Node 11 | } 12 | class sample.Node { 13 | att name : String { 14 | 15 | } 16 | rel softwares : sample.Software 17 | } 18 | class sample.Software { 19 | att name : String { 20 | 21 | } 22 | att load : Double 23 | //att load : Double { 24 | // using "Polynomial" 25 | // with precision "0.1" 26 | //} 27 | } 28 | -------------------------------------------------------------------------------- /plugins/model/sample/src/hello.mm: -------------------------------------------------------------------------------- 1 | enum hello.SmartMeterState { 2 | InError, Healthy, Pending 3 | } 4 | 5 | index clouds: cloud.Software { 6 | name 7 | } 8 | 9 | class cloud.Cloud { 10 | rel servers: cloud.Server 11 | } 12 | 13 | class cloud.Server { 14 | att name: String 15 | rel softwares: cloud.Software 16 | } 17 | 18 | class cloud.Software { 19 | att name: String 20 | att load: Double { 21 | using "PolynomialNode" 22 | with precision "0.1" 23 | } 24 | att loadProfile: Double { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /plugins/native/src/main/c/compile.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2017 The MWG Authors. All rights reserved. 4 | #

5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | #

9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | #

11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)" 19 | gcc -O2 -DNDEBUG -I $JAVA_HOME/include -I $JAVA_HOME/include/darwin -shared org_mwg_NativeHasherHelper.c -o ../resources/natives.dylib 20 | -------------------------------------------------------------------------------- /plugins/native/src/main/java/org/mwg/NativeHasherHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg; 17 | 18 | public class NativeHasherHelper { 19 | 20 | static native long tripleHash(byte p0, long p1, long p2, long p3, long max); 21 | 22 | static { 23 | System.load("/Users/duke/dev/mwDB/plugins/native/src/main/resources/natives.dylib"); 24 | } 25 | 26 | public static void main(String[] args) { 27 | long before = System.currentTimeMillis(); 28 | long sum = 0; 29 | for (long i = 0; i < 1000000000; i++) { 30 | sum += tripleHash((byte) 0, i, i * 2, i * 3, 1000000000L); 31 | } 32 | long after = System.currentTimeMillis(); 33 | System.out.println(sum + "/" + (after - before) + " ms"); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /plugins/native/src/main/resources/natives.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/plugins/native/src/main/resources/natives.dylib -------------------------------------------------------------------------------- /plugins/rest/src/doc/idea.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/plugins/rest/src/doc/idea.jpeg -------------------------------------------------------------------------------- /plugins/rest/src/doc/idea.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/plugins/rest/src/doc/idea.key -------------------------------------------------------------------------------- /plugins/search/src/main/java/org/mwg/SearchEngine.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg; 17 | 18 | public class SearchEngine { 19 | 20 | //TBD 21 | 22 | } 23 | -------------------------------------------------------------------------------- /plugins/storage/hazelcast/src/main/java/org/mwg/HazelcastJob.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg; 17 | 18 | import org.mwg.plugin.Job; 19 | 20 | import java.io.Serializable; 21 | 22 | public class HazelcastJob implements Serializable, Runnable { 23 | 24 | private Job job; 25 | 26 | public HazelcastJob(Job job) { 27 | this.job = job; 28 | } 29 | 30 | @Override 31 | public void run() { 32 | job.run(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /plugins/storage/hbase/README.md: -------------------------------------------------------------------------------- 1 | # ManyWorldGraph (aka mwg) Storage Plugin: HBase backend 2 | 3 | ## Last versions: 4 | 5 | ## Changelog 6 | 7 | ## Dependency 8 | 9 | ## Usage 10 | 11 | ## Configuration 12 | 13 | s -------------------------------------------------------------------------------- /plugins/storage/hbase/pkg/docker/conf/hbase-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | hbase.rootdir 23 | file:///home/hbase/data/hbase 24 | 25 | 26 | 27 | hbase.cluster.distributed 28 | true 29 | 30 | 31 | 32 | hbase.zookeeper.quorum 33 | 192.168.25.60:2181,192.168.25.61:2181,192.168.25.62:2181,192.168.25.63:2181 34 | 35 | 36 | -------------------------------------------------------------------------------- /plugins/storage/nats/src/main/java/org/mwg/NatsServer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg; 17 | 18 | public class NatsServer { 19 | 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /plugins/storage/riak/pkg/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 The MWG Authors. All rights reserved. 3 | #

4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | #

8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | #

10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | version: "2" 18 | services: 19 | coordinator: 20 | image: basho/riak-kv 21 | ports: 22 | - "8087:8087" 23 | - "8098:8098" 24 | environment: 25 | - CLUSTER_NAME=riakkv 26 | labels: 27 | - "com.basho.riak.cluster.name=riakkv" 28 | volumes: 29 | - schemas:/etc/riak/schemas 30 | member: 31 | image: basho/riak-kv 32 | ports: 33 | - "8087" 34 | - "8098" 35 | labels: 36 | - "com.basho.riak.cluster.name=riakkv" 37 | links: 38 | - coordinator 39 | depends_on: 40 | - coordinator 41 | environment: 42 | - CLUSTER_NAME=riakkv 43 | - COORDINATOR_NODE=coordinator 44 | 45 | volumes: 46 | schemas: 47 | external: false -------------------------------------------------------------------------------- /plugins/storage/voldemort/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 The MWG Authors. All rights reserved. 3 | #

4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | #

8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | #

10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | FROM lwieske/java-8:jdk-8u112-slim 18 | RUN apk update && apk add ca-certificates wget && update-ca-certificates && apk add openssl && apk add --update bash 19 | ENV VOLDEMORT_VERSION=release-1.10.23-cutoff 20 | RUN wget https://github.com/voldemort/voldemort/archive/$VOLDEMORT_VERSION.zip 21 | RUN unzip $VOLDEMORT_VERSION.zip && mv voldemort-* voldemort 22 | WORKDIR /voldemort/ 23 | ENV VOLDEMORT_HOME /voldemort/config/single_node_cluster 24 | RUN ./gradlew clean build -x test 25 | EXPOSE 6666 6667 8081 26 | CMD ./bin/voldemort-server.sh -------------------------------------------------------------------------------- /plugins/storage/voldemort/lib/voldemort-1.10.23.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/plugins/storage/voldemort/lib/voldemort-1.10.23.jar -------------------------------------------------------------------------------- /plugins/storage/websocket/.gitignore: -------------------------------------------------------------------------------- 1 | src/main/ts/mwg.d.ts 2 | -------------------------------------------------------------------------------- /plugins/storage/websocket/src/main/java/org/mwg/WSConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg; 17 | 18 | class WSConstants { 19 | 20 | static final String DISCONNECTED_ERROR = "Please connect your WebSocket client first."; 21 | 22 | static final byte REQ_GET = 0; 23 | static final byte REQ_PUT = 1; 24 | static final byte REQ_LOCK = 2; 25 | static final byte REQ_UNLOCK = 3; 26 | static final byte REQ_REMOVE = 4; 27 | static final byte REQ_UPDATE = 5; 28 | static final byte REQ_TASK = 6; 29 | 30 | static final byte RESP_GET = 7; 31 | static final byte RESP_PUT = 8; 32 | static final byte RESP_REMOVE = 9; 33 | static final byte RESP_LOCK = 10; 34 | static final byte RESP_UNLOCK = 11; 35 | static final byte RESP_TASK = 12; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /plugins/storage/websocket/src/main/ts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mwg-plugin-ws", 3 | "version": "1.0.0", 4 | "main": "mwg.ws.js", 5 | "typings": "mwg.ws.d.ts" 6 | } -------------------------------------------------------------------------------- /plugins/storage/websocket/src/test/resources/hello/world: -------------------------------------------------------------------------------- 1 | Hello World -------------------------------------------------------------------------------- /plugins/structure/src/main/java/org/mwg/structure/TreeResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.structure; 17 | 18 | /** 19 | * Created by assaad on 05/01/2017. 20 | */ 21 | public interface TreeResult { 22 | 23 | int size(); 24 | 25 | boolean insert(double[] key, long value, double distance); 26 | 27 | double[] keys(int index); 28 | long value(int index); 29 | double distance(int index); 30 | double getWorstDistance(); 31 | 32 | void free(); 33 | boolean isCapacityReached(); 34 | void sort(boolean ascending); 35 | } 36 | -------------------------------------------------------------------------------- /plugins/structure/src/main/java/org/mwg/structure/trees/IndexStrategy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mwg.structure.trees; 17 | 18 | class IndexStrategy { 19 | static final int INDEX = 0; 20 | static final int PROFILE = 1; 21 | //public static final int APPEND = 2; 22 | static final int DEFAULT = INDEX; 23 | } 24 | -------------------------------------------------------------------------------- /plugins/taskide/src/main/web/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | build/ -------------------------------------------------------------------------------- /plugins/taskide/src/main/web/config/jest/CSSStub.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | module.exports = {}; 17 | -------------------------------------------------------------------------------- /plugins/taskide/src/main/web/config/jest/FileStub.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | module.exports = "test-file-stub"; 17 | -------------------------------------------------------------------------------- /plugins/taskide/src/main/web/config/polyfills.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | if (typeof Promise === 'undefined') { 17 | // Rejection tracking prevents a common issue where React gets into an 18 | // inconsistent state due to an error, but it gets swallowed by a Promise, 19 | // and the user has no idea what causes React's erratic future behavior. 20 | require('promise/lib/rejection-tracking').enable(); 21 | window.Promise = require('promise/lib/es6-extensions.js'); 22 | } 23 | 24 | // fetch() polyfill for making API calls. 25 | require('whatwg-fetch'); 26 | 27 | // Object.assign() is commonly used with React. 28 | // It will use the native implementation if it's present and isn't buggy. 29 | Object.assign = require('object-assign'); 30 | -------------------------------------------------------------------------------- /plugins/taskide/src/main/web/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/plugins/taskide/src/main/web/public/favicon.ico -------------------------------------------------------------------------------- /plugins/taskide/src/main/web/public/index.html: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | MWG TaskIDE 27 | 28 | 29 |

30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /plugins/taskide/src/main/web/scripts/test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The MWG Authors. All rights reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | process.env.NODE_ENV = 'test'; 17 | process.env.PUBLIC_URL = ''; 18 | 19 | // Load environment variables from .env file. Suppress warnings using silent 20 | // if this file is missing. dotenv will never modify any environment variables 21 | // that have already been set. 22 | // https://github.com/motdotla/dotenv 23 | require('dotenv').config({silent: true}); 24 | 25 | const jest = require('jest'); 26 | const argv = process.argv.slice(2); 27 | 28 | // Watch unless on CI 29 | if (!process.env.CI) { 30 | argv.push('--watch'); 31 | } 32 | 33 | 34 | jest.run(argv); 35 | -------------------------------------------------------------------------------- /plugins/visualizer/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | 3 | #Old project 4 | old/.sass-cache 5 | old/node_modules 6 | old/build 7 | old/bower_components 8 | old/src/js/react_layout.babelify.js 9 | 10 | src/main/ts/mwg 11 | src/main/resources/js/generated 12 | -------------------------------------------------------------------------------- /plugins/visualizer/README.md: -------------------------------------------------------------------------------- 1 | Visualizer 2 | === 3 | 4 | # Features 5 | - Connect one graph either by putting the address in the url or by using the connect form 6 | - navigate through the time and world 7 | - setup the depth 8 | - show node details 9 | 10 | # To Do 11 | - [ ] TS Query to specify what to show 12 | - [ ] Nice time/world/depth picker 13 | - [ ] Refresh model every X ms (simulate listener) 14 | -------------------------------------------------------------------------------- /plugins/visualizer/old/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react", "es2015"] 3 | } -------------------------------------------------------------------------------- /plugins/visualizer/old/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "ignoredDependencies": [ 3 | "jquery" 4 | ] 5 | } -------------------------------------------------------------------------------- /plugins/visualizer/old/README.md: -------------------------------------------------------------------------------- 1 | Mwg graphical debugger 2 | === 3 | 4 | It is a web based Mwg debugger. 5 | 6 | # Requirement 7 | - npm 8 | - bower: `npm install [-g] bower` 9 | - gulp: `npm install [-g] gulp-cli` 10 | - sass: `[sudo] gem install sass` 11 | - [WebSocket plugin](../websocket) 12 | 13 | # Launch 14 | - `npm install` 15 | - `bower install` 16 | - `gulp` 17 | 18 | Now a web page will open at `localhost:8080`, you can close it. 19 | Open `index.html` file in your favorite browser. A WS client is running, and try to connect to a server on port `8050`. 20 | Thus, you just need to run one in our program : 21 | ```java 22 | WSServer serverDebug = new WSServer([YOUR GRAPH],8050); 23 | serverDebug.start(); 24 | ``` 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /plugins/visualizer/old/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mwg-debugger", 3 | "authors": [ 4 | "Lucas Martinez " 5 | ], 6 | "description": "Graphical debugger for Many World Graph", 7 | "main": "app.js", 8 | "license": "MIT", 9 | "homepage": "", 10 | "private": true, 11 | "ignore": [ 12 | "**/.*", 13 | "node_modules", 14 | "bower_components", 15 | "test", 16 | "tests" 17 | ], 18 | "dependencies": { 19 | "bulma": "^0.1.0", 20 | "vivagraphjs": "^0.8.1", 21 | "react": "^15.2.1", 22 | "font-awesome": "^4.6.3", 23 | "golden-layout": "^1.5.1", 24 | "fuse.js": "^2.3.0", 25 | "lodash": "^4.14.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /plugins/visualizer/old/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mwg-debugger", 3 | "version": "1.0.0", 4 | "description": "Graphical debugger for Many World Graph", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "author": "Lucas Martinez ", 9 | "license": "ISC", 10 | "devDependencies": { 11 | "babel-preset-es2015": "^6.9.0", 12 | "babel-preset-react": "^6.11.1", 13 | "babelify": "^7.3.0", 14 | "browserify": "^13.0.1", 15 | "del": "^2.2.1", 16 | "gulp": "^3.9.1", 17 | "gulp-babel": "^6.1.2", 18 | "gulp-concat": "^2.6.0", 19 | "gulp-filter": "^4.0.0", 20 | "gulp-ignore": "^2.0.1", 21 | "gulp-main-bower-files": "^1.5.2", 22 | "gulp-rename": "^1.2.2", 23 | "gulp-ruby-sass": "^2.0.6", 24 | "gulp-uglify": "^1.5.4", 25 | "gulp-util": "^3.0.7", 26 | "gulp-webserver": "^0.9.1", 27 | "vinyl-buffer": "^1.0.0", 28 | "vinyl-source-stream": "^1.1.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /plugins/visualizer/old/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | mwg 7 | org.kevoree.mwg 8 | 7-SNAPSHOT 9 | ../../pom.xml 10 | 11 | 4.0.0 12 | 13 | org.kevoree.mwg.plugins 14 | debugger 15 | ${parent.version} 16 | mwg :: Plugins :: Debugger 17 | 18 | 19 | -------------------------------------------------------------------------------- /plugins/visualizer/old/src/js/demo_mwg.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by lucasm on 06/07/16. 3 | */ 4 | 5 | console.time("all"); 6 | var graph = new org.mwg.GraphBuilder() 7 | .withStorage(new org.mwg.plugin.WSClient("ws://localhost:8050")) 8 | .withPlugin(new org.mwg.ml.MLPlugin()) 9 | .build(); 10 | 11 | 12 | graph.connect(function () { 13 | initVivaGraph(); 14 | }); -------------------------------------------------------------------------------- /plugins/visualizer/src/main/resources/css/visualizer.css: -------------------------------------------------------------------------------- 1 | .graphVisu { 2 | width: 100%; 3 | height: 100%; 4 | } 5 | 6 | .lm_content { 7 | background-color: white; 8 | } 9 | 10 | #wrapper { 11 | height: calc(100% - 20px); 12 | margin: 10px; 13 | } 14 | 15 | #header { 16 | height: 5%; 17 | } 18 | 19 | #header button, input{ 20 | height: 50%; 21 | } 22 | 23 | #goldenLayout { 24 | height: 95%; 25 | } 26 | 27 | .timeWorldSelector { 28 | height: 20px; 29 | width: 25%; 30 | } 31 | 32 | html, body { 33 | height: 100%; 34 | } 35 | 36 | body .lm_content{ 37 | overflow: scroll; 38 | } 39 | 40 | #queryEditor { 41 | height: 100%; 42 | width: 100%; 43 | } 44 | 45 | #monaco { 46 | height: 90%; 47 | } 48 | 49 | #monaco-run { 50 | height: 10%; 51 | margin: 5px; 52 | } 53 | 54 | #monaco-run button { 55 | height: 100%; 56 | float: right; 57 | } -------------------------------------------------------------------------------- /plugins/visualizer/src/main/resources/img/sprite-skin-flat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/plugins/visualizer/src/main/resources/img/sprite-skin-flat.png -------------------------------------------------------------------------------- /plugins/visualizer/src/main/resources/min/vs/base/common/worker/simpleWorker.nls.ja.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Version: 0.6.1(8f43cf5d0d3d233c9ba1c9085f2bb529f834c841) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt 6 | *-----------------------------------------------------------*/ 7 | define("vs/base/common/worker/simpleWorker.nls.ja",{"vs/base/common/errors":["{0}。エラー コード: {1}","アクセス許可が拒否されました (HTTP {0})","アクセス許可が拒否されました","{0} (HTTP {1}: {2})","{0} (HTTP {1})","不明な接続エラー ({0})","不明な接続エラーが発生しました。インターネット接続が切れたか、接続先のサーバーがオフラインです。","{0}: {1}","不明なエラーが発生しました。ログで詳細を確認してください。","システム エラーが発生しました ({0})","不明なエラーが発生しました。ログで詳細を確認してください。","{0} (合計 {1} エラー)","不明なエラーが発生しました。ログで詳細を確認してください。","実装されていません","無効な引数: {0}","無効な引数","無効な状態: {0}","無効な状態","必要なファイルを読み込みに失敗しました。インターネット接続が切れたか、接続先のサーバーがオフラインです。ブラウザーを更新して、もう一度やり直してください。","必要なファイルの読み込みに失敗しました。アプリケーションを再起動してもう一度試してください。詳細: {0}"],"vs/base/common/keyCodes":["Windows","コントロール","Shift","Alt","コマンド","Windows","Ctrl","Shift","Alt","コマンド","Windows"],"vs/base/common/severity":["エラー","警告","情報"]}); 8 | //# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.ja.js.map -------------------------------------------------------------------------------- /plugins/visualizer/src/main/resources/min/vs/base/common/worker/simpleWorker.nls.ko.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Version: 0.6.1(8f43cf5d0d3d233c9ba1c9085f2bb529f834c841) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt 6 | *-----------------------------------------------------------*/ 7 | define("vs/base/common/worker/simpleWorker.nls.ko",{"vs/base/common/errors":["{0}. 오류 코드: {1}","사용 권한이 거부되었습니다(HTTP {0}).","사용 권한이 거부되었습니다.","{0}(HTTP {1}: {2})","{0}(HTTP {1})","알 수 없는 연결 오류({0})","알 수 없는 연결 오류가 발생했습니다. 인터넷에 연결되지 않았거나 연결된 서버가 오프라인 상태입니다.","{0}: {1}","알 수 없는 오류가 발생했습니다. 자세한 내용은 로그를 참조하세요.","시스템 오류가 발생했습니다({0}).","알 수 없는 오류가 발생했습니다. 자세한 내용은 로그를 참조하세요.","{0}(총 {1}개의 오류)","알 수 없는 오류가 발생했습니다. 자세한 내용은 로그를 참조하세요.","구현 안 됨","잘못된 인수: {0}","잘못된 인수","잘못된 상태: {0}","잘못된 상태","필요한 파일을 로드하지 못했습니다. 인터넷에 연결되지 않았거나 연결된 서버가 오프라인 상태입니다. 브라우저를 새로 고친 후 다시 시도해 보세요.","필요한 파일을 로드하지 못했습니다. 응용 프로그램을 다시 시작하여 다시 시도하세요. 세부 정보: {0}"],"vs/base/common/keyCodes":["Windows","Ctrl","Shift","Alt","명령","Windows","Ctrl","Shift","Alt","명령","Windows"],"vs/base/common/severity":["오류","경고","정보"]}); 8 | //# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.ko.js.map -------------------------------------------------------------------------------- /plugins/visualizer/src/main/resources/min/vs/base/common/worker/simpleWorker.nls.zh-cn.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Version: 0.6.1(8f43cf5d0d3d233c9ba1c9085f2bb529f834c841) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt 6 | *-----------------------------------------------------------*/ 7 | define("vs/base/common/worker/simpleWorker.nls.zh-cn",{"vs/base/common/errors":["{0}。错误代码: {1}","权限被拒绝 (HTTP {0})","权限被拒绝","{0} (HTTP {1}: {2})","{0} (HTTP {1})","未知连接错误 ({0})","出现未知连接错误。您的 Internet 连接已断开,或者您连接的服务器已脱机。","{0}: {1}","出现未知错误。有关详细信息,请参阅日志。","发生了系统错误({0})","出现未知错误。有关详细信息,请参阅日志。","{0} 个(共 {1} 个错误)","出现未知错误。有关详细信息,请参阅日志。","未实施","非法参数: {0}","非法参数","非法状态: {0}","非法状态","无法加载需要的文件。您的 Internet 连接已断开,或者您连接的服务器已脱机。请刷新浏览器并重试。","未能加载所需文件。请重启应用程序重试。详细信息: {0}"],"vs/base/common/keyCodes":["Windows","控件","Shift","Alt","命令","Windows","Ctrl","Shift","Alt","命令","Windows"],"vs/base/common/severity":["错误","警告","信息"]}); 8 | //# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.zh-cn.js.map -------------------------------------------------------------------------------- /plugins/visualizer/src/main/resources/min/vs/base/common/worker/simpleWorker.nls.zh-tw.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Version: 0.6.1(8f43cf5d0d3d233c9ba1c9085f2bb529f834c841) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt 6 | *-----------------------------------------------------------*/ 7 | define("vs/base/common/worker/simpleWorker.nls.zh-tw",{"vs/base/common/errors":["{0}。錯誤碼: {1}","權限被拒絕 (HTTP {0})","權限被拒絕","{0} (HTTP {1}: {2})","{0} (HTTP {1})","未知的連接錯誤 ({0})","發生未知的連接錯誤。可能是您已經沒有連線到網際網路,或是您連接的伺服器已離線。","{0}: {1}","發生未知的錯誤。如需詳細資訊,請參閱記錄檔。","發生系統錯誤 ({0})","發生未知的錯誤。如需詳細資訊,請參閱記錄檔。","{0} (總計 {1} 個錯誤)","發生未知的錯誤。如需詳細資訊,請參閱記錄檔。","未實作","不合法的狀態: {0}","不合法的引數","不合法的狀態: {0}","不合法的狀態","無法載入需要的檔案。可能是您已經沒有連線到網際網路,或是您連接的伺服器已離線。請重新整理瀏覽器,再試一次。","無法載入必要的檔案。請重新啟動該應用程式,然後再試一次。詳細資料: {0}"],"vs/base/common/keyCodes":["Windows","Control","Shift","Alt","Command","Windows","Ctrl","Shift","Alt","Command","Windows"],"vs/base/common/severity":["錯誤","警告","資訊"]}); 8 | //# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.zh-tw.js.map -------------------------------------------------------------------------------- /plugins/visualizer/src/main/resources/min/vs/base/worker/workerMain.js: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | !function(){"use strict";var e=self.MonacoEnvironment,s=e&&e.baseUrl?e.baseUrl:"../../../";importScripts(s+"vs/loader.js"),require.config({baseUrl:s,catchError:!0});var n=function(e){require([e],function(e){var s=e.create(function(e){self.postMessage(e)},null);for(self.onmessage=function(e){return s.onmessage(e.data)};o.length>0;)self.onmessage(o.shift())})},r=!0,o=[];self.onmessage=function(e){return r?(r=!1,void n(e.data)):void o.push(e)}}(); 6 | //# sourceMappingURL=../../../../min-maps/vs/base/worker/workerMain.js.map -------------------------------------------------------------------------------- /plugins/visualizer/src/main/ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": true, 3 | "compilerOptions": { 4 | "outDir": "../resources/js/generated" 5 | }, 6 | "exclude": [ 7 | "mwg" 8 | ] 9 | } -------------------------------------------------------------------------------- /plugins/visualizer/src/test/java/test/DummyTest2.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | /** 4 | * Created by ludovicmouline on 15/09/16. 5 | */ 6 | public class DummyTest2 { 7 | 8 | public static void main(String[] args) { 9 | // Graph g = new GraphBuilder() 10 | // .withPlugin(new MLPlugin()) 11 | // .build(); 12 | // 13 | // g.connect(isConnected -> { 14 | // Node root = g.newNode(0,0); 15 | // root.setProperty("name",Type.INT,1); 16 | // root.setProperty("int",Type.INT,1); 17 | // root.setProperty("double",Type.DOUBLE,2.); 18 | // root.setProperty("string",Type.STRING,"Une String"); 19 | // root.setProperty("long",Type.LONG,1557456454894856454L); 20 | // root.setProperty("bool",Type.BOOL,false); 21 | // g.index("INDEX",root,"name",null); 22 | // 23 | // }); 24 | // 25 | // final WSServer server = new WSServer(g,5679); 26 | // server.start(); 27 | // 28 | // 29 | // Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { 30 | // @Override 31 | // public void run() { 32 | // server.stop(); 33 | // } 34 | // })); 35 | 36 | 37 | } 38 | 39 | } 40 | 41 | //ws://localhost:5678 -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2017 The MWG Authors. All rights reserved. 4 | #

5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | #

9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | #

11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | export JAVA_HOME=$(/usr/libexec/java_home) 19 | mvn release:clean 20 | mvn release:prepare 21 | mvn release:perform -------------------------------------------------------------------------------- /share/build_netlib/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "emlapack", 3 | "version": "0.0.1", 4 | "description": "BLAS/LAPACK for JavaScript", 5 | "main": "emlapack.js", 6 | "files": [ 7 | "emlapack.js" 8 | ], 9 | "devDependencies": { 10 | "babel": "^5.3.0", 11 | "expect.js": "^0.3.1", 12 | "gulp": "^3.8.11", 13 | "gulp-shell": "^0.4.1", 14 | "mocha": "^2.2.4" 15 | }, 16 | "scripts": { 17 | "test": "gulp test" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/likr/emlapack.git" 22 | }, 23 | "author": "Yosuke ONOUE ", 24 | "license": "BSD-3-Clause", 25 | "bugs": { 26 | "url": "https://github.com/likr/emlapack/issues" 27 | }, 28 | "homepage": "https://github.com/likr/emlapack" 29 | } 30 | -------------------------------------------------------------------------------- /share/build_netlib/src/blas-files.js: -------------------------------------------------------------------------------- 1 | var blasFiles = [ 2 | 'xerbla', 3 | 'dswap', 4 | 'dcopy', 5 | 'dgemv', 6 | 'dtrmv', 7 | 'dgemm', 8 | 'dtrmm', 9 | 'lsame','idamax','drot','dscal','dger','ddot','dnrm2','dtrsm' 10 | ]; 11 | 12 | module.exports = blasFiles; 13 | -------------------------------------------------------------------------------- /share/build_netlib/src/export.js: -------------------------------------------------------------------------------- 1 | module.exports = Module; 2 | -------------------------------------------------------------------------------- /share/build_netlib/src/lapack-files.js: -------------------------------------------------------------------------------- 1 | var lapackFiles = [ 2 | 'dbdsdc', 3 | 'dbdsqr', 4 | 'dgebd2', 5 | 'dgebrd', 6 | 'dgelq2', 7 | 'dgelqf', 8 | 'dgeqr2', 9 | 'dgeqrf', 10 | 'dgesdd', 11 | 'dgetf2', 12 | 'dgetrf', 13 | 'dgetri', 14 | 'dgetrs', 15 | 'disnan', 16 | 'dlabrd', 17 | 'dlacpy', 18 | 'dlaed6', 19 | 'dlaisnan', 20 | 'dlamrg', 21 | 'dlange', 22 | 'dlanst', 23 | 'dlapy2', 24 | 'dlarf', 25 | 'dlarfb', 26 | 'dlarfg', 27 | 'dlarft', 28 | 'dlartg', 29 | 'dlas2', 30 | 'dlascl', 31 | 'dlasd0', 32 | 'dlasd1', 33 | 'dlasd2', 34 | 'dlasd3', 35 | 'dlasd4', 36 | 'dlasd5', 37 | 'dlasd6', 38 | 'dlasd7', 39 | 'dlasd8', 40 | 'dlasda', 41 | 'dlasdq', 42 | 'dlasdt', 43 | 'dlaset', 44 | 'dlasq1', 45 | 'dlasq2', 46 | 'dlasq3', 47 | 'dlasq4', 48 | 'dlasq5', 49 | 'dlasq6', 50 | 'dlasr', 51 | 'dlasrt', 52 | 'dlassq', 53 | 'dlasv2', 54 | 'dlaswp', 55 | 'dorg2r', 56 | 'dorgbr', 57 | 'dorgl2', 58 | 'dorglq', 59 | 'dorgqr', 60 | 'dorm2r', 61 | 'dormbr', 62 | 'dorml2', 63 | 'dormlq', 64 | 'dormqr', 65 | 'dtrti2', 66 | 'dtrtri', 67 | 'ieeeck', 68 | 'iladlc', 69 | 'iladlr', 70 | 'ilaenv', 71 | 'iparmq','dlarfp' 72 | 73 | ]; 74 | 75 | module.exports = lapackFiles; 76 | -------------------------------------------------------------------------------- /share/build_netlib/src/libf2c-files.js: -------------------------------------------------------------------------------- 1 | var libf2cFiles = [ 2 | 'c_abs', 3 | 'c_div', 4 | 'c_sqrt', 5 | 'cabs', 6 | 'close', 7 | 'ctype', 8 | 'd_cnjg', 9 | 'd_imag', 10 | 'd_lg10', 11 | 'd_sign', 12 | 'endfile', 13 | 'err', 14 | 'exit_', 15 | 'f77_aloc', 16 | 'fmt', 17 | 'fmtlib', 18 | 'i_dnnt', 19 | 'i_nint', 20 | 'open', 21 | 'pow_ci', 22 | 'pow_dd', 23 | 'pow_di', 24 | 'pow_ii', 25 | 'pow_ri', 26 | 'pow_zi', 27 | 'r_cnjg', 28 | 'r_imag', 29 | 'r_lg10', 30 | 'r_sign', 31 | 's_cat', 32 | 's_cmp', 33 | 's_copy', 34 | 'sfe', 35 | 'sig_die', 36 | 'util', 37 | 'wsfe', 38 | 'wref', 39 | 'wrtfmt', 40 | 'z_abs', 41 | 'z_div', 42 | 'z_sqrt' 43 | ]; 44 | 45 | module.exports = libf2cFiles; 46 | -------------------------------------------------------------------------------- /share/build_netlib/test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true, 4 | "es6": false 5 | }, 6 | "rules": { 7 | "no-underscore-dangle": 0 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /share/build_netlib/test/blas-level1/daxpy.js: -------------------------------------------------------------------------------- 1 | var expect = require('expect.js'); 2 | var emlapack = require('../../emlapack'); 3 | 4 | describe('daxpy(n, da, dx, incx, dy, incy)', function () { 5 | it('computes dy := da * dx + dy', function () { 6 | var pn = emlapack._malloc(4); 7 | var pda = emlapack._malloc(8); 8 | var pdx = emlapack._malloc(32); 9 | var pincx = emlapack._malloc(4); 10 | var pdy = emlapack._malloc(32); 11 | var pincy = emlapack._malloc(4); 12 | 13 | var n = new Int32Array(emlapack.HEAP32.buffer, pn, 1); 14 | var da = new Float64Array(emlapack.HEAPF64.buffer, pda, 2); 15 | var dx = new Float64Array(emlapack.HEAPF64.buffer, pdx, 4); 16 | var incx = new Int32Array(emlapack.HEAP32.buffer, pincx, 1); 17 | var dy = new Float64Array(emlapack.HEAPF64.buffer, pdy, 4); 18 | var incy = new Int32Array(emlapack.HEAP32.buffer, pincy, 1); 19 | 20 | n[0] = 4; 21 | da[0] = 2.5; 22 | dx.set([1, 2, 3, 4]); 23 | incx[0] = 1; 24 | dy.set([2, 3, 4, 5]); 25 | incy[0] = 1; 26 | 27 | var daxpy = emlapack.cwrap('f2c_daxpy', null, ['number', 'number', 'number', 'number', 'number', 'number']); 28 | daxpy(pn, pda, pdx, pincx, pdy, pincy); 29 | 30 | expect(dy).to.be.eql([4.5, 8, 11.5, 15]); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /share/build_netlib/test/blas-level1/dcopy.js: -------------------------------------------------------------------------------- 1 | var expect = require('expect.js'), 2 | emlapack = require('../../emlapack'); 3 | var dcopy = emlapack.cwrap('f2c_dcopy', null, ['number', 'number', 'number', 'number', 'number']); 4 | 5 | describe('dcopy(n, dx, incx, dy, incy)', function () { 6 | it('computes dy := dx', function () { 7 | var n = 4, 8 | pn = emlapack._malloc(4), 9 | pdx = emlapack._malloc(n * 8), 10 | pincx = emlapack._malloc(4), 11 | pdy = emlapack._malloc(n * 8), 12 | pincy = emlapack._malloc(4), 13 | dx = new Float64Array(emlapack.HEAPF64.buffer, pdx, n), 14 | dy = new Float64Array(emlapack.HEAPF64.buffer, pdy, n); 15 | 16 | emlapack.setValue(pn, n, 'i32'); 17 | emlapack.setValue(pincx, 1, 'i32'); 18 | emlapack.setValue(pincy, 1, 'i32'); 19 | dx.set([1, 2, 3, 4]); 20 | 21 | dcopy(pn, pdx, pincx, pdy, pincy); 22 | 23 | expect(dy).to.be.eql([1, 2, 3, 4]); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /share/build_netlib/test/blas-level1/ddot.js: -------------------------------------------------------------------------------- 1 | var expect = require('expect.js'), 2 | emlapack = require('../../emlapack'); 3 | var ddot = emlapack.cwrap('f2c_ddot', null, ['number', 'number', 'number', 'number', 'number']); 4 | 5 | describe('ddot(n, dx, incx, dy, incy)', function () { 6 | it('returns dx^t dy', function () { 7 | var n = 4, 8 | pn = emlapack._malloc(4), 9 | pdx = emlapack._malloc(n * 8), 10 | pincx = emlapack._malloc(4), 11 | pdy = emlapack._malloc(n * 8), 12 | pincy = emlapack._malloc(4), 13 | dx = new Float64Array(emlapack.HEAPF64.buffer, pdx, n), 14 | dy = new Float64Array(emlapack.HEAPF64.buffer, pdy, n); 15 | 16 | emlapack.setValue(pn, n, 'i32'); 17 | emlapack.setValue(pincx, 1, 'i32'); 18 | emlapack.setValue(pincy, 1, 'i32'); 19 | dx.set([1, 2, 3, 4]); 20 | dy.set([2, 3, 4, 5]); 21 | 22 | expect(ddot(pn, pdx, pincx, pdy, pincy)).to.be(40); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /share/compiler.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevoree-modeling/mwDB/0b8cdca3adc136da1d8c625b4062872dbffd3d54/share/compiler.jar -------------------------------------------------------------------------------- /share/debug/debug.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /share/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mwg.generic.js", 3 | "version": "1.0.0-SNAPSHOT", 4 | "devDependencies": { 5 | "typescript": "*", 6 | "jasmine": "*", 7 | "uglify-js": "*" 8 | } 9 | } -------------------------------------------------------------------------------- /share/spacer.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /share/tar.gz.xml: -------------------------------------------------------------------------------- 1 | 3 | npm 4 | / 5 | 6 | tar.gz 7 | 8 | 9 | 10 | ${project.build.directory}/classes-npm 11 | / 12 | 13 | 14 | -------------------------------------------------------------------------------- /share/test.js: -------------------------------------------------------------------------------- 1 | var Jasmine = require('jasmine'); 2 | var jasmine = new Jasmine(); 3 | jasmine.execute(['test-classes/test.all.js']); -------------------------------------------------------------------------------- /share/zip.xml: -------------------------------------------------------------------------------- 1 | 3 | js 4 | / 5 | 6 | zip 7 | 8 | 9 | 10 | ${project.build.directory}/classes-js 11 | / 12 | 13 | 14 | --------------------------------------------------------------------------------