本文整理匯總了Python中plot.Plot.plotField方法的典型用法代碼示例。如果您正苦於以下問題:Python Plot.plotField方法的具體用法?Python Plot.plotField怎麽用?Python Plot.plotField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類plot.Plot
的用法示例。
在下文中一共展示了Plot.plotField方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Run
# 需要導入模塊: from plot import Plot [as 別名]
# 或者: from plot.Plot import plotField [as 別名]
def Run(self):
try:
field = Field(self._length, self._springconst, self._deltaslope)
field.addTubes(self._count)
plot = Plot(self._length)
tubes = field.getTubes()
# Debugging code
start = []
stop =[]
for key in field.getTubes().keys():
if field.getTubes()[key].getParams()['P'][0] <= 0:
start.append(key),","
if field.getTubes()[key].getParams()['Q'][0] >= self._length:
stop.append(key)
print "Starting Tubes:",start
print "Stopping Tubes:",stop
print "------------------------------------------"
#time.sleep(10)
plot.plotField(tubes)
end = 0
while end < 1:
field.calculateIntercepts()
point_forces = field.getPointForces()
for key in field.getTubes().keys():
print key,":",field.getTubes()[key].getParams()['neighbors'].keys()
print "=================================="
traverses = 0
neighbor_dict = {}
roots = []
leaves = []
for index in tubes.keys():
neighbor_dict[index] = list()
neighbor_dict[index] = tubes[index].getParams()['neighbors'].keys()
if tubes[index].getParams()['P'][0] <= 0:
roots.append(index)
if tubes[index].getParams()['Q'][0] >= self._length:
leaves.append(index)
#print index
for index in roots:
traverses += field.traverseNeighbors(index,neighbor_dict,leaves,())
print traverses
#if end % 1 == 0:
#plot.plotField(tubes)
#field.rotateTubes(point_forces)
end += 1
except EquitubeException, e:
raise EquitubeException(e.get_message())