本文整理汇总了Python中ColonisationAI.assignColonyFleetsToColonise方法的典型用法代码示例。如果您正苦于以下问题:Python ColonisationAI.assignColonyFleetsToColonise方法的具体用法?Python ColonisationAI.assignColonyFleetsToColonise怎么用?Python ColonisationAI.assignColonyFleetsToColonise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColonisationAI
的用法示例。
在下文中一共展示了ColonisationAI.assignColonyFleetsToColonise方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generateOrders
# 需要导入模块: import ColonisationAI [as 别名]
# 或者: from ColonisationAI import assignColonyFleetsToColonise [as 别名]
def generateOrders():
empire = fo.getEmpire()
print "Empire: " + empire.name + " TURN: " + str(fo.currentTurn())
print "Capital: " + str(empire.capitalID)
# turn cleanup
splitFleet()
identifyShipDesigns()
identifyFleetsRoles()
foAIstate.clean(ExplorationAI.getHomeSystemID(), FleetUtilsAI.getEmpireFleetIDs())
# ...missions
# ...demands/priorities
# call AI modules
PriorityAI.calculatePriorities()
ExplorationAI.assignScoutsToExploreSystems()
ColonisationAI.assignColonyFleetsToColonise()
InvasionAI.assignInvasionFleetsToInvade()
FleetUtilsAI.generateAIFleetOrdersForAIFleetMissions()
FleetUtilsAI.issueAIFleetOrdersForAIFleetMissions()
ResearchAI.generateResearchOrders()
ProductionAI.generateProductionOrders()
ResourcesAI.generateResourcesOrders()
foAIstate.afterTurnCleanup()
fo.doneTurn()
示例2: generateOrders
# 需要导入模块: import ColonisationAI [as 别名]
# 或者: from ColonisationAI import assignColonyFleetsToColonise [as 别名]
def generateOrders():
print ("Genearting Orders")
universe = fo.getUniverse()
empire = fo.getEmpire()
planetID = empire.capitalID
planet = universe.getPlanet(planetID)
print "EmpireID: " + str(empire.empireID) + " Name: " + empire.name + " Turn: " + str(fo.currentTurn())
print "CapitalID: " + str(planetID) + " Name: " + planet.name + " Species: " + planet.speciesName
# turn cleanup
splitFleet()
identifyShipDesigns()
identifyFleetsRoles()
foAIstate.clean(ExplorationAI.getHomeSystemID(), FleetUtilsAI.getEmpireFleetIDs())
# ...missions
# ...demands/priorities
print("Calling AI Modules")
# call AI modules
PriorityAI.calculatePriorities()
ExplorationAI.assignScoutsToExploreSystems()
ColonisationAI.assignColonyFleetsToColonise()
InvasionAI.assignInvasionFleetsToInvade()
MilitaryAI.assignMilitaryFleetsToSystems()
FleetUtilsAI.generateAIFleetOrdersForAIFleetMissions()
FleetUtilsAI.issueAIFleetOrdersForAIFleetMissions()
ResearchAI.generateResearchOrders()
ProductionAI.generateProductionOrders()
ResourcesAI.generateResourcesOrders()
foAIstate.afterTurnCleanup()
fo.doneTurn()
示例3: generateOrders
# 需要导入模块: import ColonisationAI [as 别名]
# 或者: from ColonisationAI import assignColonyFleetsToColonise [as 别名]
def generateOrders():
global lastTurnTimestamp
universe = fo.getUniverse()
turnStartTime=time() #starting AI timer here, to be sure AI doesn't get blame for any lags in server being able to provide the Universe object
empire = fo.getEmpire()
planetID = PlanetUtilsAI.getCapital()
planet=None
if planetID is not None:
planet = universe.getPlanet(planetID)
print "***************************************************************************"
print "***************************************************************************"
print ("Generating Orders")
print "EmpireID: " + str(empire.empireID) + " Name: " + empire.name+ "_"+str(empire.empireID-1) +"_pid:"+str(fo.playerID())+"_"+fo.playerName()+"_"+aggressions.get(foAIstate.aggression, "?") + " Turn: " + str(fo.currentTurn())
empireColor=empire.colour
print "EmpireColors: %d %d %d %d"%(empireColor.r, empireColor.g, empireColor.b, empireColor.a)
if planet:
print "CapitalID: " + str(planetID) + " Name: " + planet.name + " Species: " + planet.speciesName
else:
print "CapitalID: None Currently Name: None Species: None "
print "***************************************************************************"
print "***************************************************************************"
if fo.currentTurn() == 1:
declareWarOnAll()
# turn cleanup !!! this was formerly done at start of every turn -- not sure why
splitNewFleets()
#updateShipDesigns() #should not be needed anymore;
#updateFleetsRoles()
foAIstate.clean() #checks exploration border & clears roles/missions of missing fleets & updates fleet locs
foAIstate.reportSystemThreats()
# ...missions
# ...demands/priorities
print("Calling AI Modules")
# call AI modules
timer=[time()]
try: PriorityAI.calculatePriorities()
except: print "Error: exception triggered and caught: ", traceback.format_exc() # try traceback.print_exc()
timer.append( time() )
try: ExplorationAI.assignScoutsToExploreSystems()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
try: ColonisationAI.assignColonyFleetsToColonise()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
try: InvasionAI.assignInvasionFleetsToInvade()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
try: MilitaryAI.assignMilitaryFleetsToSystems()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
try: FleetUtilsAI.generateAIFleetOrdersForAIFleetMissions()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
try: FleetUtilsAI.issueAIFleetOrdersForAIFleetMissions()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
try: ResearchAI.generateResearchOrders()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
try: ProductionAI.generateProductionOrders()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
try: ResourcesAI.generateResourcesOrders()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
try: foAIstate.afterTurnCleanup()
except: print "Error: exception triggered and caught: ", traceback.format_exc()
timer.append( time() )
times = [timer[i] - timer[i-1] for i in range(1, len(timer) ) ]
turnEndTime=time()
timeFmt = "%30s: %8d msec "
print "AI Module Time Requirements:"
for mod, modTime in zip(__timerEntries, times):
print timeFmt%((30*' '+mod)[-30:], int(1000*modTime))
if __timerFile:
__timerFile.write( __timerFileFmt%tuple( [ fo.currentTurn() ]+map(lambda x: int(1000*x), times )) +'\n')
__timerFile.flush()
if __timerBucketFile:
__timerBucketFile.write( __timerBucketFileFmt%tuple( [ fo.currentTurn(), (turnStartTime-lastTurnTimestamp)*1000, (turnEndTime-turnStartTime)*1000 ]) +'\n')
__timerBucketFile.flush()
lastTurnTimestamp = time()
try: fo.doneTurn()
except: print "Error: exception triggered and caught: ", traceback.format_exc()