Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LogisticsNetwork

Logistics Group: efficiently partners resource requests with transporters using a stable matching algorithm to provide general-purpose resource transport. For a better explanation of how this system works, see my blog post: https://bencbartlett.wordpress.com/2018/03/28/screeps-4-hauling-is-np-hard/

Hierarchy

  • LogisticsNetwork

Index

Constructors

constructor

Properties

Private _matching

_matching: object | undefined

buffers

buffers: BufferTarget[]

Private cache

cache: object

Type declaration

colony

colony: Colony

memory

memory: LogisticsNetworkMemory

requests

requests: LogisticsRequest[]

Private targetToRequest

targetToRequest: object

Type declaration

  • [targetRef: string]: number

Accessors

matching

  • get matching(): object

Methods

bufferChoices

Private computeNextAvailability

  • computeNextAvailability(transporter: Zerg): [number, RoomPosition]

Private computePredictedTransporterCarry

  • computePredictedTransporterCarry(transporter: Zerg, nextAvailability?: [number, RoomPosition]): StoreDefinition

Private getInputAmount

  • getInputAmount(target: LogisticsTarget, resourceType: ResourceConstant): number

Private getOutputAmount

  • getOutputAmount(target: LogisticsTarget, resourceType: ResourceConstant | "all"): number

invalidateCache

Private nextAvailability

  • nextAvailability(transporter: Zerg): [number, RoomPosition]

predictedRequestAmount

  • predictedRequestAmount(transporter: Zerg, request: LogisticsRequest, nextAvailability?: [number, RoomPosition]): number

Private predictedTransporterCarry

  • predictedTransporterCarry(transporter: Zerg): StoreDefinition

refresh

  • refresh(): void

requestInput

requestOutput

requestOutputMinerals

  • requestOutputMinerals(target: StoreStructure, opts?: RequestOptions): void

requestPreferences

Private resourceChangeRate

Private stableMatching

  • stableMatching(transporters: Zerg[]): object

summarize

  • summarize(): void

summarizeMatching

  • summarizeMatching(): void

transporterPreferences

Static targetingTransporters

Object literals

Static settings

settings: object

carryThreshold

carryThreshold: number = 800

droppedEnergyThreshold

droppedEnergyThreshold: number = 200

flagDropAmount

flagDropAmount: number = 1000

rangeToPathHeuristic

rangeToPathHeuristic: number = 1.1

Generated using TypeDoc