Giter Site home page Giter Site logo

eos's Introduction

Currently API is not considered to be final (read as, what you see is stub for testing). Currently you can use engine following way:
-------------------------------------------------------------------------------

from eos import *
from eos.data.dataHandler.jsonDataHandler import JsonDataHandler


dataHandler = JsonDataHandler('/path/to/phobos/data/dump/')
engine = Eos(dataHandler, storagePath='~/path/to/logs/and/cache/', makeDefault=True)

fit = Fit()
fit.ship = Ship(11176)  # Crow

for skillId in skills:
    fit.skills.add(Skill(skillId, level=5))

fit.modules.high.equip(Module(13926, state=State.active, charge=Charge(27365)))  # DG light missile launcher with DG scourge ammo
fit.modules.high.equip(Module(13926, state=State.active, charge=Charge(27365)))  # DG light missile launcher with DG scourge ammo
fit.modules.high.equip(Module(13926, state=State.active, charge=Charge(27365)))  # DG light missile launcher with DG scourge ammo

fit.modules.med.equip(Module(19349, state=State.active))  # Gistii A-Type MWD
fit.modules.med.equip(Module(14268, state=State.active))  # TS Web
fit.modules.med.equip(Module(14244, state=State.active))  # Domi disruptor


fit.modules.low.equip(Module(13937, state=State.online))  # DG ballistic control
fit.modules.low.equip(Module(13937, state=State.online))  # DG ballistic control
fit.modules.low.equip(Module(14127, state=State.online))  # Domi nanofiber

fit.rigs.equip(Rig(31650))  # t2 rigor
fit.rigs.equip(Rig(31650))  # t2 rigor

fit.implants.add(Implant(19540))  # Snake Alpha
fit.implants.add(Implant(19551))  # Snake Beta
fit.implants.add(Implant(19553))  # Snake Gamma
fit.implants.add(Implant(19554))  # Snake Delta
fit.implants.add(Implant(19555))  # Snake Epsilon
fit.implants.add(Implant(19556))  # Snake Omega
fit.implants.add(Implant(3095))  # Agility hardwiring
fit.implants.add(Implant(24663))  # Zor Hyper-Link
fit.implants.add(Implant(3172))  # Light Missile damage hardwiring
fit.implants.add(Implant(3140))  # Missile launcher rof hardwiring

fit.boosters.add(Booster(3898))  # Quafe Zero
fit.boosters.add(Booster(28672))  # Synth Crash

fit.validate()

-------------------------------------------------------------------------------

Attributes of any item are accessible via dictionary-like objects like crow.attributes, e.g.:

>>fit.ship.attributes[37] # maxVelocity
5759.988204454497

Fit validation method currently raises exception if any fit check fails, its argument contains dictionary which explains what is wrong. If we replace domi nanofiber in above example with yet another BCS, following data will be returned:

{<eos.fit.item.module.Module object at 0x432ba10>: {1: ResourceErrorData(output=187.5, totalUsage=200.535, holderConsumption=19.845000000000002)}, <eos.fit.item.module.Module object at 0x4331050>: {1: ResourceErrorData(output=187.5, totalUsage=200.535, holderConsumption=24.0)}, <eos.fit.item.module.Module object at 0x4331410>: {1: ResourceErrorData(output=187.5, totalUsage=200.535, holderConsumption=24.0)}, <eos.fit.item.module.Module object at 0x432bcb0>: {1: ResourceErrorData(output=187.5, totalUsage=200.535, holderConsumption=25.0)}, <eos.fit.item.module.Module object at 0x432b4d0>: {1: ResourceErrorData(output=187.5, totalUsage=200.535, holderConsumption=19.845000000000002)}, <eos.fit.item.module.Module object at 0x432bd10>: {1: ResourceErrorData(output=187.5, totalUsage=200.535, holderConsumption=25.0)}, <eos.fit.item.module.Module object at 0x432b950>: {1: ResourceErrorData(output=187.5, totalUsage=200.535, holderConsumption=19.845000000000002)}, <eos.fit.item.module.Module object at 0x4331170>: {1: ResourceErrorData(output=187.5, totalUsage=200.535, holderConsumption=24.0)}, <eos.fit.item.module.Module object at 0x432bfb0>: {1: ResourceErrorData(output=187.5, totalUsage=200.535, holderConsumption=19.0)}}

Keys of dictionary are problematic modules (in this case, all CPU consumers on ship), values are dictionaries too, which list problems with given module. Keys of this dictionary are restriction IDs (eos.Restriction object), with 1 being CPU restriction; values contain detailed data about problem, in this case it's named tuple which shows ship CPU output, total CPU consumption and CPU use by current module. Different resstrictions contain different data, but in general format stays the same.

eos's People

Contributors

darkfenx avatar cncfanatics avatar

Watchers

Yury Kocharyan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.