コード例 #1
0
import sys
sys.path.append("..")
from matplotlib import pyplot as plt
from matplotlib import animation
from pylab import *
from Animat import Animat
from Environment.Environment import Environment

# Initialize an Animat

xMax = 20
yMax = 20
env = Environment(xMax, yMax, 10, 10)
animat = Animat(10, 10, xMax, yMax, env)
env.initializeWeb()
env.generateFood(5, 3, 12, 7, 17)
env.generateFood(5, 13, 3, 18, 7)
foodList = []
for e in env.foodList:
    foodList.append((e.x, e.y))
#print 'Food list : {}'.format(foodList)
foodList = zip(*foodList)
#print 'Modified : {}'.format(foodList)

# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(xlim=(0, xMax), ylim=(0, yMax))
#---
#data = [(2,2),(0,10),(3,3),(2,8),(4,4),(2,8),(5,5),(2,8),(6,6),(2,8),(7,7),(2,8),(8,8),(0,10),(0,10),(2,2),(2,8),(3,3),(2,8),(4,4),(2,8),(5,5),(2,8),(6,6),(2,8),(7,7),(0,10),(8,8)]
#---
data = [(4, 4), (0, 20), (6, 6), (4, 16), (8, 8), (4, 16), (10, 10), (4, 16),
コード例 #2
0
import sys
sys.path.append("..")
from matplotlib import pyplot as plt
from matplotlib import animation
from pylab import *
from Animat import Animat
from Environment.Environment import Environment

# Initialize an Animat

xMax = 20
yMax = 20
env = Environment(xMax, yMax, 10, 10)
animat = Animat(10, 10, xMax, yMax, env)
env.initializeWeb()
env.generateFood(15, 10, 4, 16, 16)
foodList = []

for e in env.foodList:
    foodList.append((e.x, e.y))
#print 'Food list : {}'.format(foodList)
foodList = zip(*foodList)
#print 'Modified : {}'.format(foodList)

# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(xlim=(0, xMax), ylim=(0, yMax))

#------------Initial Web Structure already built------------#
data = [(4, 4), (0, 20), (6, 6), (4, 16), (8, 8), (4, 16), (10, 10), (4, 16),
        (12, 12), (4, 16), (14, 14), (4, 16), (16, 16), (0, 20), (0, 20),
コード例 #3
0
import sys
sys.path.append("..")
from matplotlib import pyplot as plt
from matplotlib import animation
from pylab import *
from Animat import Animat
from Environment.Environment import Environment

# Initialize an Animat

xMax = 20
yMax = 20
env = Environment(xMax, yMax, 10, 10)
animat = Animat(10, 10, xMax, yMax,env)
env.initializeWeb()
env.generateFood(15, 10,4,16,16)
foodList =[]

for e in env.foodList:
	foodList.append((e.x,e.y))
#print 'Food list : {}'.format(foodList)
foodList = zip(*foodList)
#print 'Modified : {}'.format(foodList)


# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(xlim=(0, xMax), ylim=(0, yMax))

#------------Initial Web Structure already built------------#
data = [(4,4),(0,20),(6,6),(4,16),(8,8),(4,16),(10,10),(4,16),(12,12),(4,16),(14,14),(4,16),(16,16),(0,20),(0,20),(4,4),(4,16),(6,6),(4,16),(8,8),(4,16),(10,10),(4,16),(12,12),(4,16),(14,14),(0,20),(16,16)]
コード例 #4
0
import sys
sys.path.append("..")
from matplotlib import pyplot as plt
from matplotlib import animation
from pylab import *
from Animat import Animat
from Environment.Environment import Environment

# Initialize an Animat

xMax = 20
yMax = 20
env = Environment(xMax, yMax, 10, 10)
animat = Animat(10, 10, xMax, yMax,env)
env.initializeWeb()
env.generateFood(15, 0 ,0,20 ,20)
foodList =[]
for e in env.foodList:
	foodList.append((e.x,e.y))
#print 'Food list : {}'.format(foodList)
foodList = zip(*foodList)
#print 'Modified : {}'.format(foodList)


# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(xlim=(0, xMax), ylim=(0, yMax))

data = [(4,4),(0,20),(6,6),(4,16),(8,8),(4,16),(10,10),(4,16),(12,12),(4,16),(14,14),(4,16),(16,16),(0,20),(0,20),(4,4),(4,16),(6,6),(4,16),(8,8),(4,16),(10,10),(4,16),(12,12),(4,16),(14,14),(0,20),(16,16)]

plt.plot(*data,color='k', linestyle='--')
コード例 #5
0
import sys
sys.path.append("..")
from matplotlib import pyplot as plt
from matplotlib import animation
from pylab import *
from Animat import Animat
from Environment.Environment import Environment

# Initialize an Animat

xMax = 20
yMax = 20
env = Environment(xMax, yMax, 10, 10)
animat = Animat(10, 10, xMax, yMax,env)
env.initializeWeb()
env.generateFood(5, 3,12,7,17)
env.generateFood(5,13,3,18,7)
foodList =[]
for e in env.foodList:
	foodList.append((e.x,e.y))
#print 'Food list : {}'.format(foodList)
foodList = zip(*foodList)
#print 'Modified : {}'.format(foodList)


# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(xlim=(0, xMax), ylim=(0, yMax))
#---
#data = [(2,2),(0,10),(3,3),(2,8),(4,4),(2,8),(5,5),(2,8),(6,6),(2,8),(7,7),(2,8),(8,8),(0,10),(0,10),(2,2),(2,8),(3,3),(2,8),(4,4),(2,8),(5,5),(2,8),(6,6),(2,8),(7,7),(0,10),(8,8)]
#---