Beispiel #1
0
 def shoot(self, player):
     bub = bubble.Bubble(player.id)
     coordinate = pos.Coordinate(-1,-1)
     
     if player.dir == "right":
         if player.id == 1:
             bub.setupBubble(1)
         else:
             bub.setupBubble(1)
         bub.action = "shoot_r"
         coordinate.setCoordinate(player.coordinate.row, player.coordinate.column + 1)
     elif player.dir == "left":
         if player.id == 1:
             bub.setupBubble(1)
         else:
             bub.setupBubble(1)  
         bub.action = "shoot_l"
         coordinate.setCoordinate(player.coordinate.row, player.coordinate.column - 1)
 
     self.gameEngine.move(coordinate, bub)
import bubble as b
import insertion as i
import selection as s

a = [6, 5, 4, 3, 2, 1, 7, 9, 10, 34]
b = [1, 2, 3, 4, 5, 6]

bub = b.Bubble(a)
bub.bubble()

sel = s.Selection(a)
sel.selection()

ins = s.Insertion(a)
ins.insertion()
Beispiel #3
0
    lineC = ALine(-7.9, 3, 7.9, 3, .03)
    lineD = ALine(-7.9, 4, 7.9, 4, .03)
    lineE = ALine(-7.9, 5, 7.9, 5, .03)
    lineF = ALine(-7.9, 6, 7.9, 6, .03)
    list.append(lineA)
    list.append(lineB)
    list.append(lineC)
    list.append(lineD)
    list.append(lineE)
    list.append(lineF)

    import bubble
    import start

    for i in range(10):
        t = start.StartControl(-7.9 + i + 0.5, 1, 0.2)
        lineA.add(i, t)

    import bubble
    import start

    for i in range(10):
        b = bubble.Bubble(-7.9 + i, 2, 0.1)
        lineB.add(i, b)

    import testbed

    mainWin = testbed.MainWindow(list)
    mainWin.show()
    sys.exit(app.exec_())
Beispiel #4
0
# dMu2, dMu3, dMu4 = -0.1520, -0.0696, -0.041  # lambda=0.5
# dMu2, dMu3, dMu4 = -0.1251, -0.0742, -0.0494  # lambda=1.0

# rs=3, beta=25
dMu2, dMu3, dMu4 = -0.10773, -0.0499, -0.0322  # lambda=0.3

Para = param(D, Spin)

DataDict, Step, Groups, ReWeight, Grids = LoadFile("data", "pid[0-9]+.dat")
KGrid = Grids["KGrid"]
print Groups

###### Calculate finite-temperature polarization ################
BubbleQ = np.zeros(len(KGrid))
for qi, q in enumerate(KGrid):
    BubbleQ[qi] = bubble.Bubble(D, Para.Beta, Spin, Para.kF, q)[0]
    # print "{0:10.6f}  {1:10.6f}".format(q/Para.kF, BubbleQ[qi])
################################################################

Bubble = bubble.Bubble(D, Para.Beta, Spin, Para.kF, 0.0)
print "Uniform Polarization: ", Bubble[0], "+-", Bubble[1]
print "Uniform polarization for the Free electron at T=0: ", Para.Nf
Phys = Bubble[0] * len(KGrid)

EsDataDict = {}
for g in DataDict.keys():
    print g
    EsDataDict[g] = reduce.EstimateGroup(DataDict, Step, Phys, g)

for (o, key) in enumerate(sorted(EsDataDict.keys())):
    if key == (0, ):
Beispiel #5
0
plt.switch_backend('TkAgg')
mat.rcParams.update({'font.size': 16})
mat.rcParams["font.family"] = "Times New Roman"
size = 12

D = 3
Spin = 2
Para = param(D, Spin)

DataDict, Step, Groups, ReWeight, Grids = LoadFile("data", "pid[0-9]+.dat")
KGrid = Grids["KGrid"]
# for i in range(len(Data)):
#     print i, Data[i][1, 0]

Bubble = bubble.Bubble(D, Para.Beta, Spin, Para.kF, 0.0)
print "Uniform Polarization: ", Bubble[0], "+-", Bubble[1]
print "Uniform polarization for the Free electron at T=0: ", Para.Nf
Phys = Bubble[0]*len(KGrid)
# Phys = Para.Nf*len(KGrid)

EsDataDict = {}
for g in DataDict.keys():
    EsDataDict[g] = reduce.EstimateGroup(DataDict, Step, Phys, g)

for (o, key) in enumerate(sorted(EsDataDict.keys())):
    if key == (0, ):
        continue
    y = EsDataDict[key]
    print yellow("(Order: {0}, VerCT: {1}, SigamCT: {2}) = {3:12.6f} +- {4:12.6f}".format(
        key[0], key[1], key[2], np.average(y[0]), np.average(y[1])*2.0))