Learning Time Machines Implemented
This commit is contained in:
1 parent
e8a3cdceea
commit
6cd1d9d47f
2 files changed
+67
-35
No files matched your search
@@ -4,7 +4,7 @@ function newSuperalgosFunctionLibraryChartingSpaceFunctions() {
|
||||
addAllLayerPolygons: addAllLayerPolygons,
|
||||
addAllMineLayers: addAllMineLayers,
|
||||
addMissingDashboards: addMissingDashboards,
|
||||
addMissingProjectDashboards: addMissingProjectDashboards,
|
||||
addMissingProjectDashboards: addMissingProjectDashboards,
|
||||
addMissingTimeMachines: addMissingTimeMachines,
|
||||
createTimeMachine: createTimeMachine
|
||||
}
|
||||
@@ -155,7 +155,7 @@ function newSuperalgosFunctionLibraryChartingSpaceFunctions() {
|
||||
for (let j = 0; j < mineProducts.length; j++) {
|
||||
let mineProduct = mineProducts[j]
|
||||
/*
|
||||
The mine products found so far, belongs to any session. To filer all the sessions
|
||||
The mine products found so far, belongs to any session. To filter all the sessions
|
||||
that are not the one we are interested in, we do the following:
|
||||
*/
|
||||
if (mineProduct.payload.parentNode === undefined) { continue }
|
||||
@@ -208,6 +208,65 @@ function newSuperalgosFunctionLibraryChartingSpaceFunctions() {
|
||||
}
|
||||
}
|
||||
/*
|
||||
We will create 3 Time Line Charts for the Learning Mine Products
|
||||
*/
|
||||
mineProducts = UI.projects.superalgos.utilities.branches.nodeBranchToArray(networkNode, 'Learning Mine Products')
|
||||
for (let j = 0; j < mineProducts.length; j++) {
|
||||
let mineProduct = mineProducts[j]
|
||||
/*
|
||||
The mine products found so far, belongs to any session. To filter all the sessions
|
||||
that are not the one we are interested in, we do the following:
|
||||
*/
|
||||
if (mineProduct.payload.parentNode === undefined) { continue }
|
||||
if (mineProduct.payload.parentNode.payload.referenceParent.id !== session.id) { continue }
|
||||
/*
|
||||
At the current version of Superalgos, beta 6, there is only one Learning Mine,
|
||||
with only one bot, and it has so many data products that we want to put them
|
||||
in 3 different timeline charts. So we will create 3 charts, connect them,
|
||||
and delete from each one 1/3 of the layers. We do all that next:
|
||||
*/
|
||||
|
||||
for (let k = 0; k < 3; k++) {
|
||||
let timelineChart = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(timeMachine, 'Timeline Chart')
|
||||
|
||||
timelineChart.layerManager.payload.referenceParent = mineProduct
|
||||
timelineChart.payload.floatingObject.collapseToggle()
|
||||
timelineChart.layerManager.payload.floatingObject.collapseToggle()
|
||||
timelineChart.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
|
||||
timelineChart.layerManager.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
|
||||
|
||||
let menu = timelineChart.layerManager.payload.uiObject.menu
|
||||
menu.internalClick('Add All Mine Layers')
|
||||
menu.internalClick('Add All Mine Layers')
|
||||
|
||||
switch (k) {
|
||||
case 0: {
|
||||
timelineChart.name = 'Learning Engine'
|
||||
deleteNodeByName('Learning System')
|
||||
deleteNodeByName('Simulation Objects')
|
||||
break
|
||||
}
|
||||
case 1: {
|
||||
timelineChart.name = 'Learning System'
|
||||
deleteNodeByName('Learning Engine')
|
||||
deleteNodeByName('Simulation Objects')
|
||||
break
|
||||
}
|
||||
case 2: {
|
||||
timelineChart.name = 'Simulation Objects'
|
||||
deleteNodeByName('Learning Engine')
|
||||
deleteNodeByName('Learning System')
|
||||
break
|
||||
}
|
||||
}
|
||||
function deleteNodeByName(nodeName) {
|
||||
let nodeToDelete = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(timelineChart.layerManager, undefined, nodeName, true, true, false, false)
|
||||
if (nodeToDelete === undefined) { return }
|
||||
UI.projects.superalgos.functionLibraries.nodeDeleter.deleteUIObject(nodeToDelete, rootNodes)
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
We need to create a Timeline Chart for each Data Mine Products.
|
||||
*/
|
||||
mineProducts = UI.projects.superalgos.utilities.branches.nodeBranchToArray(networkNode, 'Data Mine Products')
|
||||
@@ -234,37 +293,6 @@ function newSuperalgosFunctionLibraryChartingSpaceFunctions() {
|
||||
timelineChart.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
|
||||
timelineChart.layerManager.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
|
||||
|
||||
let menu = timelineChart.layerManager.payload.uiObject.menu
|
||||
menu.internalClick('Add All Mine Layers')
|
||||
menu.internalClick('Add All Mine Layers')
|
||||
}
|
||||
/*
|
||||
We need to create a Timeline Chart for each Learning Mine Products.
|
||||
*/
|
||||
mineProducts = UI.projects.superalgos.utilities.branches.nodeBranchToArray(networkNode, 'Learning Mine Products')
|
||||
for (let j = 0; j < mineProducts.length; j++) {
|
||||
let mineProduct = mineProducts[j]
|
||||
/*
|
||||
We need to filter out the ones that do not belong to the market where
|
||||
the session is running at.
|
||||
*/
|
||||
if (mineProduct.payload.parentNode.payload.parentNode.payload.referenceParent === undefined) { continue }
|
||||
if (mineProduct.payload.parentNode.payload.parentNode.payload.referenceParent.id !== market.id) { continue }
|
||||
|
||||
let timelineChart = UI.projects.superalgos.functionLibraries.uiObjectsFromNodes.addUIObject(timeMachine, 'Timeline Chart')
|
||||
/*
|
||||
The Mine Product Node might be collapesd and since its creation it never
|
||||
received the physics call, so we will do the call so that it properly
|
||||
sets its own name, which we are going to reuse here.
|
||||
*/
|
||||
mineProduct.payload.uiObject.invisiblePhysics()
|
||||
timelineChart.name = mineProduct.name + ' Learning'
|
||||
timelineChart.layerManager.payload.referenceParent = mineProduct
|
||||
timelineChart.payload.floatingObject.collapseToggle()
|
||||
timelineChart.layerManager.payload.floatingObject.collapseToggle()
|
||||
timelineChart.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
|
||||
timelineChart.layerManager.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
|
||||
|
||||
let menu = timelineChart.layerManager.payload.uiObject.menu
|
||||
menu.internalClick('Add All Mine Layers')
|
||||
menu.internalClick('Add All Mine Layers')
|
||||
|
||||
@@ -333,9 +333,13 @@ function newSuperalgosFunctionLibraryCryptoEcosystemFunctions() {
|
||||
/* This will be needed at the charting space, for creating Dashboards */
|
||||
let backLearningSessionsArray = UI.projects.superalgos.utilities.branches.nodeBranchToArray(marketLearningTask, 'Back Learning Session')
|
||||
let liveLearningSessionsArray = UI.projects.superalgos.utilities.branches.nodeBranchToArray(marketLearningTask, 'Live Learning Session')
|
||||
learningSessionsCreatedArray = learningSessionsCreatedArray
|
||||
.concat(backLearningSessionsArray)
|
||||
|
||||
let allSessionsArray = backLearningSessionsArray
|
||||
.concat(liveLearningSessionsArray)
|
||||
|
||||
learningSessionsCreatedArray = learningSessionsCreatedArray.concat(allSessionsArray)
|
||||
|
||||
dashboardsArray.push({ environmentNode: learningTasks, networkNode: networkNode, sessionsArray: allSessionsArray })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user