Demagic WorkspaceStructure. NFC.
This commit is contained in:
@ -5,7 +5,8 @@ class Bond(WorkspaceStructure):
|
|||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments
|
||||||
def __init__(self, source, destination, bondCategory, bondFacet,
|
def __init__(self, source, destination, bondCategory, bondFacet,
|
||||||
sourceDescriptor, destinationDescriptor):
|
sourceDescriptor, destinationDescriptor):
|
||||||
WorkspaceStructure.__init__(self)
|
from context import context as ctx
|
||||||
|
WorkspaceStructure.__init__(self, ctx)
|
||||||
slipnet = self.ctx.slipnet
|
slipnet = self.ctx.slipnet
|
||||||
self.source = source
|
self.source = source
|
||||||
self.string = self.source.string
|
self.string = self.source.string
|
||||||
|
|||||||
@ -4,7 +4,12 @@ import random
|
|||||||
|
|
||||||
import codeletMethods
|
import codeletMethods
|
||||||
import formulas
|
import formulas
|
||||||
|
from bond import Bond
|
||||||
from codelet import Codelet
|
from codelet import Codelet
|
||||||
|
from correspondence import Correspondence
|
||||||
|
from description import Description
|
||||||
|
from group import Group
|
||||||
|
from rule import Rule
|
||||||
|
|
||||||
|
|
||||||
NUMBER_OF_BINS = 7
|
NUMBER_OF_BINS = 7
|
||||||
@ -192,8 +197,6 @@ class Coderack(object):
|
|||||||
The new codelet has urgency a function of
|
The new codelet has urgency a function of
|
||||||
the degree of conceptual-depth of the descriptions in the rule
|
the degree of conceptual-depth of the descriptions in the rule
|
||||||
"""
|
"""
|
||||||
from rule import Rule
|
|
||||||
|
|
||||||
rule = Rule(facet, description, category, relation)
|
rule = Rule(facet, description, category, relation)
|
||||||
rule.updateStrength()
|
rule.updateStrength()
|
||||||
if description and relation:
|
if description and relation:
|
||||||
@ -206,8 +209,6 @@ class Coderack(object):
|
|||||||
|
|
||||||
def proposeCorrespondence(self, initialObject, targetObject,
|
def proposeCorrespondence(self, initialObject, targetObject,
|
||||||
conceptMappings, flipTargetObject, oldCodelet):
|
conceptMappings, flipTargetObject, oldCodelet):
|
||||||
from correspondence import Correspondence
|
|
||||||
|
|
||||||
correspondence = Correspondence(initialObject, targetObject,
|
correspondence = Correspondence(initialObject, targetObject,
|
||||||
conceptMappings, flipTargetObject)
|
conceptMappings, flipTargetObject)
|
||||||
for mapping in conceptMappings:
|
for mapping in conceptMappings:
|
||||||
@ -227,8 +228,6 @@ class Coderack(object):
|
|||||||
oldCodelet, urgency, correspondence)
|
oldCodelet, urgency, correspondence)
|
||||||
|
|
||||||
def proposeDescription(self, objekt, type_, descriptor, oldCodelet):
|
def proposeDescription(self, objekt, type_, descriptor, oldCodelet):
|
||||||
from description import Description
|
|
||||||
|
|
||||||
description = Description(objekt, type_, descriptor)
|
description = Description(objekt, type_, descriptor)
|
||||||
descriptor.buffer = 100.0
|
descriptor.buffer = 100.0
|
||||||
urgency = type_.activation
|
urgency = type_.activation
|
||||||
@ -242,7 +241,6 @@ class Coderack(object):
|
|||||||
|
|
||||||
def proposeGroup(self, objects, bondList, groupCategory, directionCategory,
|
def proposeGroup(self, objects, bondList, groupCategory, directionCategory,
|
||||||
bondFacet, oldCodelet):
|
bondFacet, oldCodelet):
|
||||||
from group import Group
|
|
||||||
slipnet = self.ctx.slipnet
|
slipnet = self.ctx.slipnet
|
||||||
bondCategory = groupCategory.getRelatedNode(slipnet.bondCategory)
|
bondCategory = groupCategory.getRelatedNode(slipnet.bondCategory)
|
||||||
bondCategory.buffer = 100.0
|
bondCategory.buffer = 100.0
|
||||||
@ -255,8 +253,6 @@ class Coderack(object):
|
|||||||
|
|
||||||
def proposeBond(self, source, destination, bondCategory, bondFacet,
|
def proposeBond(self, source, destination, bondCategory, bondFacet,
|
||||||
sourceDescriptor, destinationDescriptor, oldCodelet):
|
sourceDescriptor, destinationDescriptor, oldCodelet):
|
||||||
from bond import Bond
|
|
||||||
|
|
||||||
bondFacet.buffer = 100.0
|
bondFacet.buffer = 100.0
|
||||||
sourceDescriptor.buffer = 100.0
|
sourceDescriptor.buffer = 100.0
|
||||||
destinationDescriptor.buffer = 100.0
|
destinationDescriptor.buffer = 100.0
|
||||||
|
|||||||
@ -7,7 +7,8 @@ import formulas
|
|||||||
class Correspondence(WorkspaceStructure):
|
class Correspondence(WorkspaceStructure):
|
||||||
def __init__(self, objectFromInitial, objectFromTarget,
|
def __init__(self, objectFromInitial, objectFromTarget,
|
||||||
conceptMappings, flipTargetObject):
|
conceptMappings, flipTargetObject):
|
||||||
WorkspaceStructure.__init__(self)
|
from context import context as ctx
|
||||||
|
WorkspaceStructure.__init__(self, ctx)
|
||||||
self.objectFromInitial = objectFromInitial
|
self.objectFromInitial = objectFromInitial
|
||||||
self.objectFromTarget = objectFromTarget
|
self.objectFromTarget = objectFromTarget
|
||||||
self.conceptMappings = conceptMappings
|
self.conceptMappings = conceptMappings
|
||||||
|
|||||||
@ -4,7 +4,8 @@ from workspaceStructure import WorkspaceStructure
|
|||||||
|
|
||||||
class Description(WorkspaceStructure):
|
class Description(WorkspaceStructure):
|
||||||
def __init__(self, workspaceObject, descriptionType, descriptor):
|
def __init__(self, workspaceObject, descriptionType, descriptor):
|
||||||
WorkspaceStructure.__init__(self)
|
from context import context as ctx
|
||||||
|
WorkspaceStructure.__init__(self, ctx)
|
||||||
self.object = workspaceObject
|
self.object = workspaceObject
|
||||||
self.string = workspaceObject.string
|
self.string = workspaceObject.string
|
||||||
self.descriptionType = descriptionType
|
self.descriptionType = descriptionType
|
||||||
|
|||||||
@ -3,7 +3,8 @@ from workspaceStructure import WorkspaceStructure
|
|||||||
|
|
||||||
class Replacement(WorkspaceStructure):
|
class Replacement(WorkspaceStructure):
|
||||||
def __init__(self, objectFromInitial, objectFromModified, relation):
|
def __init__(self, objectFromInitial, objectFromModified, relation):
|
||||||
WorkspaceStructure.__init__(self)
|
from context import context as ctx
|
||||||
|
WorkspaceStructure.__init__(self, ctx)
|
||||||
self.objectFromInitial = objectFromInitial
|
self.objectFromInitial = objectFromInitial
|
||||||
self.objectFromModified = objectFromModified
|
self.objectFromModified = objectFromModified
|
||||||
self.relation = relation
|
self.relation = relation
|
||||||
|
|||||||
@ -7,7 +7,8 @@ import formulas
|
|||||||
|
|
||||||
class Rule(WorkspaceStructure):
|
class Rule(WorkspaceStructure):
|
||||||
def __init__(self, facet, descriptor, category, relation):
|
def __init__(self, facet, descriptor, category, relation):
|
||||||
WorkspaceStructure.__init__(self)
|
from context import context as ctx
|
||||||
|
WorkspaceStructure.__init__(self, ctx)
|
||||||
self.facet = facet
|
self.facet = facet
|
||||||
self.descriptor = descriptor
|
self.descriptor = descriptor
|
||||||
self.category = category
|
self.category = category
|
||||||
|
|||||||
@ -8,7 +8,8 @@ from workspaceStructure import WorkspaceStructure
|
|||||||
class WorkspaceObject(WorkspaceStructure):
|
class WorkspaceObject(WorkspaceStructure):
|
||||||
# pylint: disable=too-many-instance-attributes
|
# pylint: disable=too-many-instance-attributes
|
||||||
def __init__(self, workspaceString):
|
def __init__(self, workspaceString):
|
||||||
WorkspaceStructure.__init__(self)
|
from context import context as ctx
|
||||||
|
WorkspaceStructure.__init__(self, ctx)
|
||||||
self.string = workspaceString
|
self.string = workspaceString
|
||||||
self.descriptions = []
|
self.descriptions = []
|
||||||
self.extrinsicDescriptions = []
|
self.extrinsicDescriptions = []
|
||||||
|
|||||||
@ -7,8 +7,7 @@ def abstract_call(objekt, name):
|
|||||||
|
|
||||||
|
|
||||||
class WorkspaceStructure(object):
|
class WorkspaceStructure(object):
|
||||||
def __init__(self):
|
def __init__(self, ctx):
|
||||||
from context import context as ctx
|
|
||||||
self.ctx = ctx
|
self.ctx = ctx
|
||||||
self.string = None
|
self.string = None
|
||||||
self.internalStrength = 0.0
|
self.internalStrength = 0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user