Пример #1
0

##DEFINITIONS OF STUFF
d = []
d = os.getcwd() + "/"
curSide = ["Left", "Right", "Middle"]
#defintions for FBCA generation
libFBCAGen.CALength = 20  #Length of the generated image (for min use 5)
libFBCAGen.CAWidth = 20  #Width of the generated image (for min use 4)
libFBCAGen.useImages = 1  #checks if you want images This is annoying
libFBCAGen.numOfGens = 20  #number of generations
libFBCAGen.numOfStates = 2  #number of states (good until 10)
smallDelta = 1e-6
CAMapInit = []
borderLambdas = []
CAMapInit = libFBCAGen.initCA(CAMapInit)

##START
edgeRecord = open("morphEdges", "r")
#loops through files
for line in edgeRecord:
    splits = []
    sM1 = []
    sM2 = []
    lambdas = []
    levelMap = []
    splits = line.split("sMs")
    lambdas = convTextListToList(splits[0])
    sM1 = convTextListToList(splits[1])
    sM2 = convTextListToList(splits[2])
    for lamb in lambdas:
Пример #2
0
    scoreMatrix=[]
    lambd=0
    xSpot=0
    behaviourNum=-1

##INITS 
## Morph visualziation varbs
morphRes=1000 #How many equally spaced score matrices are generated btwn sM1 and sM2
imageHeight=100 #Height of the generated image 
#Defintions for FBCA generation (this is used to generate the 'vertex CAs')
libFBCAGen.useImages=0 #generate gifs? 
libFBCAGen.finalImage=0 #generate final level map?
libFBCAGen.numOfGens=20 #number of generations
libFBCAGen.random.seed(1) #set to 1 for constant
libFBCAGen.numOfStates=4 #set correctly
CAMapInit=[];CAMapInit=libFBCAGen.initCA(CAMapInit) #Get L_0

d=[];d=os.getcwd()+"/" #Get directory
quantiferRead= "small"
quantifer = "small"

#Score matrix inits
crissCrossRecord=open(f"crissCross {quantifer}", "r")
sMs=[]
for line in crissCrossRecord:
    line=line.split(":")[2][:-2]
    sMs.append(libFBCAGen.convTextListToList(line))

## MAIN ## 

# Generates the images for the vertexs 
Пример #3
0
import FBCAConsts
import libFBCAGen
# generate a text file
exFBCA = FBCAConsts.Fbca()
exFBCA.scoreMatrix = [0, 0.5, 0.2, 0.6]
exFBCA.levelMap = libFBCAGen.initCA(exFBCA)
exFBCA.g = 6
libFBCAGen.genText(exFBCA, fileName="readTextExample.txt")
# read from text
fileToReadFrom = "readTextExample.txt"
listOfFBCAs = libFBCAGen.readFBCA(fileToReadFrom)
print(listOfFBCAs[0].g)
print(listOfFBCAs[0].n)
print(listOfFBCAs[0].torusWidth)
print(listOfFBCAs[0].torusLength)
print(listOfFBCAs[0].scoreMatrix)
print(listOfFBCAs[0].neighbourhood)
libFBCAGen.generateFBCA(exFBCA, quantifer="/original", saveImages=True)
libFBCAGen.generateFBCA(listOfFBCAs[0], quantifer="/new", saveImages=True)