本文整理匯總了Python中FleetUtilsAI.issueAIFleetOrdersForAIFleetMissions方法的典型用法代碼示例。如果您正苦於以下問題:Python FleetUtilsAI.issueAIFleetOrdersForAIFleetMissions方法的具體用法?Python FleetUtilsAI.issueAIFleetOrdersForAIFleetMissions怎麽用?Python FleetUtilsAI.issueAIFleetOrdersForAIFleetMissions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FleetUtilsAI
的用法示例。
在下文中一共展示了FleetUtilsAI.issueAIFleetOrdersForAIFleetMissions方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: generateOrders
# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import issueAIFleetOrdersForAIFleetMissions [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 FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import issueAIFleetOrdersForAIFleetMissions [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 FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import issueAIFleetOrdersForAIFleetMissions [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()