SleelaDoc API
HTML documentation for the SLeeLa standard library (/lib)
Home › Packages › advantage

Package advantage

This package contains 206 source unit(s) defining 206 class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.

advantage-demo #sleela 3.0 (lib/advantage/advantage-demo.sleela)

AdvantageDemo class

Runnable demonstration + validation of the advantage onion model (user's model and developer's model).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

AdvantageModulesDemo #sleela 3.0 (lib/advantage/modules/demo/AdvantageModulesDemo.sleela)

AdvantageModulesDemo class

Advantage module host demo: a user defined program loads the medium, then some

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkvoid check(String what, boolean ok)No description in source.
reqSLAdvMessage req(String to, String topic)No description in source.
candSLAdvMessage cand(double e, double c, double n, double s, double v, double a, double q, double p, double t, double d, double now)No description in source.
judgeMsgSLAdvMessage judgeMsg(SLMoralTrade t)No description in source.
mainvoid main()No description in source.

AdvProgramListener #sleela 3.0 (lib/advantage/modules/demo/AdvProgramListener.sleela)

AdvProgramListener class

Example listener for the demo: a user defined program callback that counts what

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
eventsint events = 0The program side of the conversation. A module speaks, this is called.
errorsint errors = 0No description in source.
readyCountint readyCount = 0No description in source.
vetoesint vetoes = 0No description in source.
judgedEventsint judgedEvents = 0No description in source.
lastVerdictint lastVerdict = -1No description in source.
haltedEventsint haltedEvents = 0No description in source.
lastTopicString lastTopic = ""No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
onMessageint onMessage(SLAdvMessage m)No description in source.

AdvUserEchoModule #sleela 3.0 (lib/advantage/modules/demo/AdvUserEchoModule.sleela)

AdvUserEchoModule class

Example user defined module: it echoes the first number doubled, and tells the

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
brSLAdvBridge brNo description in source.
onboolean on = falseNo description in source.
servedint served = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
moduleNameString moduleName()No description in source.
moduleKindString moduleKind()No description in source.
moduleVersionString moduleVersion()No description in source.
runningboolean running()No description in source.
beginboolean begin(SLAdvBridge bridge)No description in source.
endvoid end()No description in source.
handleint handle(SLAdvMessage m)No description in source.
getServedint getServed()No description in source.

AdvUserPingModule #sleela 3.0 (lib/advantage/modules/demo/AdvUserPingModule.sleela)

AdvUserPingModule class

Example user defined module for the safety test: answers every request by

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
brSLAdvBridge brNo description in source.
onboolean on = falseNo description in source.
myNameString myName = "ping-a"No description in source.
partnerString partner = "ping-b"No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
setNamesvoid setNames(String mine, String other)No description in source.
moduleNameString moduleName()No description in source.
moduleKindString moduleKind()No description in source.
moduleVersionString moduleVersion()No description in source.
runningboolean running()No description in source.
beginboolean begin(SLAdvBridge bridge)No description in source.
endvoid end()No description in source.
handleint handle(SLAdvMessage m)No description in source.

business-exchange #sleela 3.0 (lib/advantage/medium-results/business-exchange.sleela)

BusinessExchange class

MEDIUM-RESULT (Business). Demonstrates connecting, controlling, and executing a trade over open exchange in the USA using the advantage connect medium (SLNetConnector, SLClockConnector, SLSqlConnector, SLMoneyConnector) together with the network subject (SLMarketScout, SLNegotiationRound, SLCashflow). A small-business wholesale buy/sell.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

cement-trade #sleela 3.0 (lib/advantage/examples/novice/network-trades/cement-trade.sleela)

CementTrade class

NETWORK-TRADE 02 of 12 -- CEMENT. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: a bulk building material, bought by the pallet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

coffee-green-trade #sleela 3.0 (lib/advantage/examples/medium/network-trades/coffee-green-trade.sleela)

CoffeeGreenTrade class

NETWORK-TRADE 05 of 12 -- COFFEE-GREEN. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: a soft commodity with seasonality baked into the spread.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

connect-demo #sleela 3.0 (lib/advantage/connect/connect-demo.sleela)

ConnectDemo class

Runnable demonstration + validation of the advantage/connect medium end to end: the shared status vocabulary and fault record, then each of the four connectors (SQL, national clock, network, money) driven through its lifecycle, its native-adapter boundary, and a fault path.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

consumer-example #sleela 3.0 (lib/advantage/examples/novice/consumer-outcomes/consumer-example.sleela)

ConsumerExample class

A professional example -- the CONSUMER -- uses the simple user's model of the Sequitur onion to advantage a household budget.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

copper-wire-trade #sleela 3.0 (lib/advantage/examples/medium/network-trades/copper-wire-trade.sleela)

CopperWireTrade class

NETWORK-TRADE 03 of 12 -- COPPER-WIRE. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: a refined industrial input; now with a settlement fee.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

cotton-bales-trade #sleela 3.0 (lib/advantage/examples/medium/network-trades/cotton-bales-trade.sleela)

CottonBalesTrade class

NETWORK-TRADE 06 of 12 -- COTTON-BALES. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: both frictions together: fee AND carry on the same trade.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

DiAgreement #sleela 3.0 (lib/advantage/learner-vs-professional/series/04-agreement/DiAgreement.sleela)

DiAgreement class

Device Instructor agreement test: the student and the Purchase Master each build a registry of the same field and the instructor points at exactly what differs.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
studentSLNounRegistry student = new SLNounRegistry()No description in source.
masterSLNounRegistry master = new SLNounRegistry()No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
compareint compare()Prints each difference and returns the number of differences.
verdictvoid verdict(int diffs)No description in source.
mainvoid main()No description in source.

DiNestedCarriers #sleela 3.0 (lib/advantage/learner-vs-professional/series/05-nested-carriers/DiNestedCarriers.sleela)

DiNestedCarriers class

Device Instructor lesson on nested carriers: a carrier can itself be carried, every chain leads back to the field, and each noun has exactly one place.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
regSLNounRegistry reg = new SLNounRegistry()No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
tryRegistervoid tryRegister(String noun, String carrier)No description in source.
mainvoid main()No description in source.

DiPurchaseOnion #sleela 3.0 (lib/advantage/learner-vs-professional/series/06-purchase-onion/DiPurchaseOnion.sleela)

DiPurchaseOnion class

Device Instructor lesson taking registry to onion: the student totals registered quotes by hand, the Purchase Master runs the Sequitur onion, and the instructor compares.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
regSLNounRegistry reg = new SLNounRegistry()No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
loadQuotesvoid loadQuotes(boolean discountSeen)No description in source.
studentTotalint studentTotal(String supplier)The student: a plain sum of every registered value under the supplier.
masterTotalint masterTotal(String label, int quote, int fee, int discount)The Purchase Master: the same figures through the advantage onion.
pickString pick(int a, int b)Tie norm: supplier A is chosen when the two totals are equal.
mainvoid main()No description in source.

DiRegistryIntake #sleela 3.0 (lib/advantage/learner-vs-professional/series/01-registry-intake/DiRegistryIntake.sleela)

DiRegistryIntake class

Device Instructor intake: the shared registry refuses input until a field of observation is declared and keeps one carrier per noun.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
regSLNounRegistry reg = new SLNounRegistry()No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
tryRegistervoid tryRegister(String noun, String carrier)No description in source.
mainvoid main()No description in source.

DiStudentInput #sleela 3.0 (lib/advantage/learner-vs-professional/series/02-student-input-gate/DiStudentInput.sleela)

DiStudentInput class

Device Instructor gate that accepts only good student input: a claim, evidence registered in the shared registry, and the next step in sequitur order.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
regSLNounRegistry reg = new SLNounRegistry()No description in source.
lastStepint lastStep = 0No description in source.
goodint good = 0No description in source.
refusedint refused = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
submitint submit(int step, String claim, String evidence)Result codes: 0 good, 1 empty claim, 2 evidence not registered, 3 step out of order.
reasonString reason(int code)No description in source.
showvoid show(int step, String claim, String evidence)No description in source.
mainvoid main()No description in source.

DiSystemReadiness #sleela 3.0 (lib/advantage/learner-vs-professional/series/03-system-readiness/DiSystemReadiness.sleela)

DiSystemReadiness class

Device Instructor check that the system reports enough good input to teach: each reading is present, plausible and sufficient, or honestly not observed.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
namesString[] names = new String[5]No description in source.
readingsint[] readings = new int[5]No description in source.
minimumsint[] minimums = new int[5]No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
setupvoid setup()No description in source.
reportvoid report(int slot, int value)No description in source.
statusint status(int slot)Status codes: 0 ready, 1 not observed, 2 implausible, 3 below minimum.
wordString word(int code)No description in source.
auditint audit()Prints the report and returns how many checks are not ready.
verdictvoid verdict(int bad)No description in source.
mainvoid main()No description in source.

DiTradeAluminum #sleela 3.0 (lib/advantage/learner-vs-professional/series/25-trade-aluminum/DiTradeAluminum.sleela)

DiTradeAluminum class

Device Instructor trading decision 25: aluminum, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeCement #sleela 3.0 (lib/advantage/learner-vs-professional/series/08-trade-cement/DiTradeCement.sleela)

DiTradeCement class

Device Instructor trading decision 8: cement, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeCoffee #sleela 3.0 (lib/advantage/learner-vs-professional/series/11-trade-coffee/DiTradeCoffee.sleela)

DiTradeCoffee class

Device Instructor trading decision 11: coffee, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeCopper #sleela 3.0 (lib/advantage/learner-vs-professional/series/09-trade-copper/DiTradeCopper.sleela)

DiTradeCopper class

Device Instructor trading decision 9: copper, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeCotton #sleela 3.0 (lib/advantage/learner-vs-professional/series/12-trade-cotton/DiTradeCotton.sleela)

DiTradeCotton class

Device Instructor trading decision 12: cotton, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeEightWayCapstone #sleela 3.0 (lib/advantage/learner-vs-professional/series/32-trade-eight-way-capstone/DiTradeEightWayCapstone.sleela)

DiTradeEightWayCapstone class

Device Instructor trading decision 32: eight-way capstone, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeFreight #sleela 3.0 (lib/advantage/learner-vs-professional/series/21-trade-freight/DiTradeFreight.sleela)

DiTradeFreight class

Device Instructor trading decision 21: freight, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeFuel #sleela 3.0 (lib/advantage/learner-vs-professional/series/20-trade-fuel/DiTradeFuel.sleela)

DiTradeFuel class

Device Instructor trading decision 20: fuel, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeGlass #sleela 3.0 (lib/advantage/learner-vs-professional/series/29-trade-glass/DiTradeGlass.sleela)

DiTradeGlass class

Device Instructor trading decision 29: glass, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeLithium #sleela 3.0 (lib/advantage/learner-vs-professional/series/14-trade-lithium/DiTradeLithium.sleela)

DiTradeLithium class

Device Instructor trading decision 14: lithium, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeLumber #sleela 3.0 (lib/advantage/learner-vs-professional/series/07-trade-lumber/DiTradeLumber.sleela)

DiTradeLumber class

Device Instructor trading decision 7: lumber, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeNickel #sleela 3.0 (lib/advantage/learner-vs-professional/series/27-trade-nickel/DiTradeNickel.sleela)

DiTradeNickel class

Device Instructor trading decision 27: nickel, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradePaper #sleela 3.0 (lib/advantage/learner-vs-professional/series/30-trade-paper/DiTradePaper.sleela)

DiTradePaper class

Device Instructor trading decision 30: paper, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeResin #sleela 3.0 (lib/advantage/learner-vs-professional/series/31-trade-resin/DiTradeResin.sleela)

DiTradeResin class

Device Instructor trading decision 31: plastic resin, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeRice #sleela 3.0 (lib/advantage/learner-vs-professional/series/23-trade-rice/DiTradeRice.sleela)

DiTradeRice class

Device Instructor trading decision 23: rice, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeRubber #sleela 3.0 (lib/advantage/learner-vs-professional/series/28-trade-rubber/DiTradeRubber.sleela)

DiTradeRubber class

Device Instructor trading decision 28: rubber, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeSemiconductors #sleela 3.0 (lib/advantage/learner-vs-professional/series/15-trade-semiconductors/DiTradeSemiconductors.sleela)

DiTradeSemiconductors class

Device Instructor trading decision 15: semiconductors, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeServerRacks #sleela 3.0 (lib/advantage/learner-vs-professional/series/16-trade-server-racks/DiTradeServerRacks.sleela)

DiTradeServerRacks class

Device Instructor trading decision 16: server racks, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeSmartphones #sleela 3.0 (lib/advantage/learner-vs-professional/series/17-trade-smartphones/DiTradeSmartphones.sleela)

DiTradeSmartphones class

Device Instructor trading decision 17: smartphones, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeSolar #sleela 3.0 (lib/advantage/learner-vs-professional/series/13-trade-solar/DiTradeSolar.sleela)

DiTradeSolar class

Device Instructor trading decision 13: solar panels, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeSteel #sleela 3.0 (lib/advantage/learner-vs-professional/series/10-trade-steel/DiTradeSteel.sleela)

DiTradeSteel class

Device Instructor trading decision 10: steel, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeSugar #sleela 3.0 (lib/advantage/learner-vs-professional/series/24-trade-sugar/DiTradeSugar.sleela)

DiTradeSugar class

Device Instructor trading decision 24: sugar, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeTelevisions #sleela 3.0 (lib/advantage/learner-vs-professional/series/18-trade-televisions/DiTradeTelevisions.sleela)

DiTradeTelevisions class

Device Instructor trading decision 18: televisions, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeTieCapstone #sleela 3.0 (lib/advantage/learner-vs-professional/series/22-trade-tie-capstone/DiTradeTieCapstone.sleela)

DiTradeTieCapstone class

Device Instructor trading decision 22: tie capstone, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeWheat #sleela 3.0 (lib/advantage/learner-vs-professional/series/19-trade-wheat/DiTradeWheat.sleela)

DiTradeWheat class

Device Instructor trading decision 19: wheat, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

DiTradeZinc #sleela 3.0 (lib/advantage/learner-vs-professional/series/26-trade-zinc/DiTradeZinc.sleela)

DiTradeZinc class

Device Instructor trading decision 26: zinc, with the student and the Purchase Master compared entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

economics-exchange #sleela 3.0 (lib/advantage/medium-results/economics-exchange.sleela)

EconomicsExchange class

MEDIUM-RESULT (Economics). Connect, control, and execute a coordinated buyer+seller trade over open exchange in the USA, using the math subject (joint profit max + Nash bargaining) for the clearing price and the connect medium for the connection, settlement, and record. Theme: Economics -- maximize the surplus, then split it fairly.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

grading-demo #sleela 3.0 (lib/advantage/grading/grading-demo.sleela)

GradingDemo class

Runnable demonstration + validation of the sophistication circuit grader (modules, sets, ratings).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

grading-primer #sleela 3.0 (lib/advantage/examples/professional/sophistication-grading/grading-primer.sleela)

GradingPrimer class

Runnable demonstration + validation of the sophistication circuit grader (modules, sets, ratings).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

healer-example #sleela 3.0 (lib/advantage/examples/advanced/trust-fields/healer-example.sleela)

HealerExample class

A professional example -- the HEALER -- restores trust over time and measures the cost of a breach, via the trust-decay SDE.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

helper-example #sleela 3.0 (lib/advantage/examples/medium/supply-chains/helper-example.sleela)

HelperExample class

A professional example -- the HELPER -- stands up a small supply->retail chain and moves goods through it (vertical integration).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

HstDemo #sleela 3.0 (lib/advantage/modules/trader/HstDemo.sleela)

HstDemo class

Runnable check of the high speed trader engine.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.
evalsPerSimSecondint evalsPerSimSecond = 5000No description in source.
maxMinutedouble maxMinute = 0.0No description in source.
lastMinutedouble lastMinute = 0.0No description in source.
lastPnldouble lastPnl = 0.0No description in source.
lastAcceptedint lastAccepted = 0No description in source.
lastWallSecondsdouble lastWallSeconds = 0.0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkvoid check(String what, boolean ok)No description in source.
rundouble run(SLHighSpeedTrader tr, SLHstMarket mk, int simSeconds)No description in source.
vetoReportvoid vetoReport(SLHighSpeedTrader tr, SLHstPragmatics reg)No description in source.
mainvoid main()No description in source.

installer-demo #sleela 3.0 (lib/advantage/connect/installer-demo.sleela)

InstallerDemo class

Runnable demonstration + validation of SLTechInstallerII -- the Tech Installer II authority (Max Rupplin / MEARVK LLC, North Carolina, 2026+) installing the actual Use of the Advantage System onto install sets and settings, ceteris paribus, with authority gating and fault handling.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

integration-demo #sleela 3.0 (lib/advantage/integration/integration-demo.sleela)

IntegrationDemo class

Runnable demonstration + validation of the vertical-integration subject (compartments, bays, trials, newton trays, recursion).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

integration-primer #sleela 3.0 (lib/advantage/examples/advanced/vertical-integration/integration-primer.sleela)

IntegrationPrimer class

Runnable demonstration + validation of the vertical-integration subject (compartments, bays, trials, newton trays, recursion).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

lithium-cell-trade #sleela 3.0 (lib/advantage/examples/advanced/network-trades/lithium-cell-trade.sleela)

LithiumCellTrade class

NETWORK-TRADE 08 of 12 -- LITHIUM-CELL. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: a high-volume cell; small unit price, large position.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

lumber-trade #sleela 3.0 (lib/advantage/examples/novice/network-trades/lumber-trade.sleela)

LumberTrade class

NETWORK-TRADE 01 of 12 -- LUMBER. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: the entry rung of the ladder: a raw structural commodity.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

math-primer #sleela 3.0 (lib/advantage/examples/medium/trade-economics/math-primer.sleela)

MathPrimer class

Runnable demonstration + validation of the advantage/math trade subject (joint profit max, Nash bargaining, bilateral newsvendor).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

MoralDemo #sleela 3.0 (lib/advantage/modules/moral/MoralDemo.sleela)

MoralDemo class

Runnable check of the Moral Evaluator.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.
seedint seed = 20261113No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkvoid check(String what, boolean ok)No description in source.
rnddouble rnd()No description in source.
showvoid show(SLMoralEvaluator ev, String label)No description in source.
mainvoid main()No description in source.

network-demo #sleela 3.0 (lib/advantage/network/network-demo.sleela)

NetworkDemo class

Runnable demonstration + validation of the advantage/network subject (SLMarketScout, SLNegotiationRound, SLCashflow) end to end: scout a network of venue quotes, pick the best buy/sell, negotiate a fair clearing price, and emit a cash-flow receipt.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

onion-primer #sleela 3.0 (lib/advantage/examples/novice/onion-model/onion-primer.sleela)

OnionPrimer class

Runnable demonstration + validation of the advantage onion model (user's model and developer's model).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

output-demo #sleela 3.0 (lib/advantage/output/output-demo.sleela)

OutputDemo class

Runnable demonstration + validation of the advantage output seam (terminal / CommonRails / socket-connector / silent).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

output-primer #sleela 3.0 (lib/advantage/examples/medium/output-routing/output-primer.sleela)

OutputPrimer class

Runnable demonstration + validation of the advantage output seam (terminal / CommonRails / socket-connector / silent).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

physics-demo #sleela 3.0 (lib/advantage/physics/physics-demo.sleela)

PhysicsDemo class

Runnable demonstration + validation of the advantage/physics trust-field subject (metric, geodesic, contact, SDE).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

physics-primer #sleela 3.0 (lib/advantage/examples/advanced/trust-fields/physics-primer.sleela)

PhysicsPrimer class

Runnable demonstration + validation of the advantage/physics trust-field subject (metric, geodesic, contact, SDE).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

professionals-demo #sleela 3.0 (lib/advantage/examples/professional/sophistication-grading/professionals-demo.sleela)

ProfessionalsDemo class

An advantage example cast for professional roles -- grade a set of professionals as modules and rank them A..D.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

semiconductor-trade #sleela 3.0 (lib/advantage/examples/advanced/network-trades/semiconductor-trade.sleela)

SemiconductorTrade class

NETWORK-TRADE 09 of 12 -- SEMICONDUCTOR. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: a scarce input: strong seller power and both frictions.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

server-rack-trade #sleela 3.0 (lib/advantage/examples/professional/network-trades/server-rack-trade.sleela)

ServerRackTrade class

NETWORK-TRADE 10 of 12 -- SERVER-RACK. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: capital equipment; a few units, large ticket.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

SLAdvantageDeveloperModel #sleela 3.0 (lib/advantage/SLAdvantageDeveloperModel.sleela)

SLAdvantageDeveloperModel class

The developer's model -- full-control encapsulation of the advantage onion process.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
onionSLAdvantageSequitur onion---- Developer-facing engine state ----
dividendSLAdvantageDividend dividendNo description in source.
passesint passeshow many inward passes have been run

Methods — the actions this unit can perform.

MethodSignatureWhat it does
initvoid init(String label, String model, int baseValue)Stand up a fresh engine around a unique dividend wrt a model.
setOwnervoid setOwner(String ownerName)Name the party to whose advantage the model is tuned, and re-snapshot so the owner is part of the restitution point.
getOwnerString getOwner()No description in source.
getOnionSLAdvantageSequitur getOnion()Direct access to the layered machine.
getDividendSLAdvantageDividend getDividend()No description in source.
getPassesint getPasses()No description in source.
setLayervoid setLayer(int depth, int contribution)---- Shape the onion: set each stage's signed contribution ----
setReviewvoid setReview(int c)Named convenience tuners for the standard stages.
setConcernsvoid setConcerns(int c)No description in source.
setMathsvoid setMaths(int c)No description in source.
setAdditionsvoid setAdditions(int c)No description in source.
setSubtractionvoid setSubtraction(int c)No description in source.
setRegroupingvoid setRegrouping(int c)No description in source.
setIterationvoid setIteration(int c)No description in source.
deeperint deeper()---- Navigate the onion by hand ----
shallowerint shallower()No description in source.
seekvoid seek(int d)No description in source.
depthint depth()No description in source.
stepvoid step()Apply only the layer under the cursor (manual single-step advantaging).
runPassint runPass()Run one complete inward pass over all layers; returns the net advantage.
iterateint iterate(int maxPasses)Iterate: run further passes while they keep improving the advantage, up to a cap. Because the standard layers are idempotent per base, a pass rebases first so each pass is a clean re-evaluation; returns the final advantage.
updateModelvoid updateModel(String newModel, String newLabel, int newBase)---- Dynamically alter or update the model ---- Re-point the dividend to a new model / label / base at runtime. The onion shape is preserved; only the frame of reference and starting value change. Pass null for model or label to leave that field unchanged. The original identity captured at init() is preserved so restitute() can fully undo it.
favorOwnerint favorOwner(int strength)Dynamically bias the whole model toward the owner's advantage by a non-negative strength. Returns the net contribution gained for the owner. This is an ALTERATION, not a reset -- it stacks on the current shape until restitute() is called.
restitutevoid restitute()---- Full restitute ---- Restore BOTH the dividend's identity and the onion's shape to the state captured at init()/setOwner()/snapshotShape(), and clear the pass counter. A complete undo of every dynamic alteration, to the owner's benefit of a clean, known-good baseline.
commitBaselinevoid commitBaseline()Commit the current altered state as the NEW restitution baseline, so a later restitute() returns here rather than to the init() state.
advantageint advantage()Current net advantage of the dividend.
describeString describe()No description in source.
emitThroughvoid emitThrough(SLAdvantageEmitter em)Report this model through an output emitter (terminal / commonrails / socket / silent). The emitter and its sink decide the destination.

SLAdvantageDividend #sleela 3.0 (lib/advantage/SLAdvantageDividend.sleela)

SLAdvantageDividend class

The unique dividend that the onion model advantages, held with respect to a named model.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
labelString label---- Dividend state ---- the unique identity of this dividend
modelString modelthe model (frame of reference) it is held with respect to
ownerString ownerthe party to whose advantage the model is tuned
baseint basethe starting value before any layer is applied
currentint currentthe running value as layers are applied
originalLabelString originalLabel---- Original snapshot, captured at configure() for full restitute ----
originalModelString originalModelNo description in source.
originalOwnerString originalOwnerNo description in source.
originalBaseint originalBaseNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String lbl, String mdl, int baseValue)No description in source.
snapshotvoid snapshot()Record the current identity as the restitution point.
getLabelString getLabel()No description in source.
getModelString getModel()No description in source.
getOwnerString getOwner()No description in source.
setOwnervoid setOwner(String o)No description in source.
getBaseint getBase()No description in source.
getCurrentint getCurrent()No description in source.
setCurrentvoid setCurrent(int v)No description in source.
updateModelvoid updateModel(String newModel, String newLabel, int newBase)---- Dynamic update: re-point the model without losing the snapshot. ---- Pass null for any field to leave it unchanged. The original snapshot is preserved so a later restitute() can undo every change at once.
restitutevoid restitute()---- Full restitute: restore the dividend to its original identity. ----
advantageint advantage()The net advantage: how far the dividend has moved from its base.
rebasevoid rebase()Reset the running value back to the base for a fresh pass.
describeString describe()No description in source.

SLAdvantageEmitter #sleela 3.0 (lib/advantage/output/SLAdvantageEmitter.sleela)

SLAdvantageEmitter class

The emitter -- the output API advantage modules call to report themselves, routed through a sink and optionally formatted via CommonRails.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
sinkSLAdvantageSink sinkNo description in source.
railPrintRail railreused CommonRails renderer for the commonrails target

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(SLAdvantageSink s)No description in source.
getSinkSLAdvantageSink getSink()No description in source.
linevoid line(String text, int textChars)Emit a raw line to the sink's target, with its byte length for the socket wire account.
brandAdvantagevoid brandAdvantage()No description in source.
statevoid state(String label, int labelChars, String message, int messageChars)No description in source.
statusvoid status(String label, String message)Convenience state() when CommonRails formatting is not needed: no counts.
reportvoid report(String subject, String body)Emit "subject: body".
pairvoid pair(String field, int fieldChars, String value, int valueChars,No description in source.
componentvoid component(String name, int nameChars, int oid, int dateSeq,No description in source.
gradevoid grade(String moduleName, int moduleChars, String rating, int ratingChars)Emit a module rating line, e.g. "GRADE integration -> S10". Char counts are supplied so the commonrails target aligns correctly.

SLAdvantageLayer #sleela 3.0 (lib/advantage/SLAdvantageLayer.sleela)

SLAdvantageLayer class

One concentric layer of the advantage Sequitur onion model.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
depthint depth---- Layer identity and behavior ---- position in the onion; 0 = outermost
layerNameString layerNamehuman name of this stage
kindString kindcategory: value|validate|risk|quant|grow|shrink|reorg|loop
contributionint contributionsigned amount this layer applies to the dividend
visitedboolean visitedhas this layer been applied on the current pass

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(int d, String nm, String k, int c)No description in source.
getDepthint getDepth()No description in source.
getNameString getName()No description in source.
getKindString getKind()No description in source.
getContributionint getContribution()No description in source.
setContributionvoid setContribution(int c)No description in source.
wasVisitedboolean wasVisited()No description in source.
markVisitedvoid markVisited()No description in source.
resetVisitvoid resetVisit()No description in source.
applyToint applyTo(int running)Apply this layer to a running dividend value and return the new value. The sign/role is governed by `kind`; the amount is `contribution`.
describeString describe()No description in source.

SLAdvantageSequitur #sleela 3.0 (lib/advantage/SLAdvantageSequitur.sleela)

SLAdvantageSequitur class

The Sequitur list -- the ordered, navigable onion of advantage layers.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
layersSLAdvantageLayer[] layers---- Onion state ---- the ordered list, index == depth
countint countnumber of layers in use
cursorint cursorcurrent depth (0..count-1)
originalint[] originaloriginal per-layer contributions, captured for full restitute

Methods — the actions this unit can perform.

MethodSignatureWhat it does
buildStandardvoid buildStandard()Build the standard eight-layer Sequitur. Contributions are the DEFAULT shape of the onion; callers may retune any layer via layerAt()/setContribution.
snapshotShapevoid snapshotShape()Capture the current onion shape (each layer's contribution) as the restitution point. Called after buildStandard and callable again after a caller deliberately commits a new baseline shape.
sizeint size()No description in source.
depthint depth()No description in source.
layerAtSLAdvantageLayer layerAt(int d)Return the layer at a given depth. Bind to a typed local before calling methods on it (array-element type is lost on inline calls).
canGoInwardboolean canGoInward()---- Navigation: iterate further down or up the onion ----
canGoOutwardboolean canGoOutward()No description in source.
goInwardint goInward()Move one layer inward (deeper). Returns the new depth.
goOutwardint goOutward()Move one layer outward (shallower). Returns the new depth.
seekvoid seek(int d)Jump the cursor directly to a depth, clamped into range.
tunevoid tune(int d, int contribution)---- Tuning: set a layer's contribution by depth ----
restitutevoid restitute()---- Full restitute: restore every layer to its snapshot shape ---- Undoes all dynamic retuning since the last snapshotShape(), returning the onion to its captured baseline. The cursor returns to the outer skin.
favorOwnerint favorOwner(int strength)---- Favor the owner: bias the onion toward the owner's advantage ---- A dynamic alteration that nudges the growth-side layers up and softens the loss-side layers, by a non-negative `strength`. Concretely: additions and the quantitative core gain +strength; a subtraction (a cost, held as a negative) is softened toward zero by up to strength; regrouping recovers +strength via reorganization. Validate/risk/loop layers are left untouched because favoring must not fabricate a clean review or silence a concern. Returns the net change in total contribution applied to the owner's favor.
totalContributionint totalContribution()Sum of every layer's current contribution.
applyCurrentvoid applyCurrent(SLAdvantageDividend div)Apply the layer at the cursor to the dividend's running value.
runInwardPassint runInwardPass(SLAdvantageDividend div)One full inward pass: apply every layer from skin to core in order, folding each contribution into the dividend. Returns the net advantage.
resetVisitsvoid resetVisits()Reset the visited flags on every layer for a fresh pass.
visitedCountint visitedCount()How many layers were touched on the last pass.

SLAdvantageSink #sleela 3.0 (lib/advantage/output/SLAdvantageSink.sleela)

SLAdvantageSink class

An output sink for the advantage package -- routes rendered lines to the terminal, a CommonRails surface, a socket/connector, or a silent capture buffer.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
targetint target---- Sink state ----
endpointString endpointconnector identity for the socket target, e.g. "host:port"
captureString capturecapture of everything emitted (framed), joined with newlines
linesint linesNo description in source.
connectorOpenboolean connectorOpenSOCKET connector lifecycle: is the connector open, and how many content bytes have been handed to it (the wire-faithful byte account CommonRails also insists on, since Core has no string-length primitive).
bytesWrittenint bytesWrittenNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
TERMINALint TERMINAL()---- Target constants (methods cost no layout slot) ----
COMMONRAILSint COMMONRAILS()No description in source.
SOCKETint SOCKET()No description in source.
SILENTint SILENT()No description in source.
configurevoid configure(int tgt)No description in source.
bindEndpointvoid bindEndpoint(String ep)For the SOCKET target: name the connector endpoint (modelled, not dialed). (Named bindEndpoint, not connect: connect is a reserved Munction builtin.)
openConnectorboolean openConnector()No description in source.
closeConnectorvoid closeConnector()Close the connector (native: slnet_close). Idempotent.
isOpenboolean isOpen()No description in source.
getTargetint getTarget()No description in source.
getEndpointString getEndpoint()No description in source.
frameCountint frameCount()No description in source.
getBytesWrittenint getBytesWritten()No description in source.
appendFramevoid appendFrame(String framed)Append to the capture with a separating newline between frames.
wireWriteint wireWrite(String framed, int byteCount)No description in source.
emitvoid emit(String line, int byteCount)No description in source.
emitLinevoid emitLine(String line)Backward-compatible emit without a byte count (socket account uses 0 for the body; the endpoint prefix is still counted).
lastFrameString lastFrame()The most recent framed line (empty if nothing emitted).
drainString drain()Drain and clear the capture, returning everything buffered. A native socket producer calls this and writes the result to the connector. The byte account and open state are preserved across a drain (the connector stays open until closeConnector).
targetNameString targetName()No description in source.
describeString describe()No description in source.

SLAdvantageUserModel #sleela 3.0 (lib/advantage/SLAdvantageUserModel.sleela)

SLAdvantageUserModel class

The user's model -- a simple, outcome-facing encapsulation of the advantage onion process.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
engineSLAdvantageDeveloperModel engine---- Simple user state (delegates to a hidden developer model) ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
startvoid start(String dividendLabel, String model, int baseValue)Start: name the unique dividend and the model it respects, with a base.
ownedByvoid ownedBy(String ownerName)Declare who owns this advantage (the party it is tuned to favor).
growvoid grow(int amount)Three plain dials in the user's language. Each maps to onion layers. grow -> additions layer; bigger upside.
shrinkvoid shrink(int amount)shrink -> subtraction layer; a cost or haircut (pass a negative amount).
rethinkvoid rethink(int maths, int regroup)rethink -> maths + regrouping; a quantitative adjustment and a reorg.
advantageint advantage()Press the button: run the whole layered process once and return the net advantage of the dividend with respect to its model.
advantageHarderint advantageHarder(int tries)Try harder: let the process iterate further through the onion, keeping the best net advantage found, up to a small cap the user chooses.
updateModelvoid updateModel(String newModel, int newBase)---- Dynamically update the model, to the owner's advantage ---- Re-point the dividend to a new model / base at runtime without losing the original. Pass null for newModel to keep the current model name.
favorMevoid favorMe(int strength)Tip the whole model further in the owner's favor by a simple strength.
restitutevoid restitute()---- Full restitute: undo every change, back to the original model ----
currentValueint currentValue()Read the outcome in plain terms.
summaryString summary()No description in source.
advancedSLAdvantageDeveloperModel advanced()A user who becomes curious can still reach the full developer controls.

SLAdvBridge #sleela 3.0 (lib/advantage/modules/SLAdvBridge.sleela)

SLAdvBridge class

The Advantage bridge: the middle proponent of communication, both ways.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
toModSLAdvMessage[] toModMessages addressed to program flow up; every other address flows down to the medium, which routes it to a module. Both queues are bounded (1024). A refused post returns -1 and is counted: the bridge fails closed.
toProgSLAdvMessage[] toProgNo description in source.
mHeadint mHead = 0No description in source.
mCountint mCount = 0No description in source.
pHeadint pHead = 0No description in source.
pCountint pCount = 0No description in source.
capint cap = 1024No description in source.
nextIdint nextId = 1No description in source.
postedint posted = 0No description in source.
droppedint dropped = 0No description in source.
upint up = 0No description in source.
downint down = 0No description in source.
isOpenboolean isOpen = falseNo description in source.
builtboolean built = falseNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
buildvoid build()No description in source.
openBridgevoid openBridge()No description in source.
shutvoid shut()No description in source.
openedboolean opened()No description in source.
getPostedint getPosted()No description in source.
getDroppedint getDropped()No description in source.
getUpint getUp()No description in source.
getDownint getDown()No description in source.
pendingModulesint pendingModules()No description in source.
pendingProgramint pendingProgram()No description in source.
postint post(SLAdvMessage m)No description in source.
nextForModulesSLAdvMessage nextForModules()No description in source.
nextForProgramSLAdvMessage nextForProgram()No description in source.
takeReplySLAdvMessage takeReply(int id)No description in source.

SLAdvCatalog #sleela 3.0 (lib/advantage/modules/SLAdvCatalog.sleela)

SLAdvCatalog class

The catalog of Advantage modules the medium can load by name.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
countint count()No description in source.
nameAtString nameAt(int i)No description in source.
knowsboolean knows(String name)No description in source.
createSLAdvModule create(String name)Build a fresh module by name, or null when the name is unknown.

SLAdvListener #sleela 3.0 (lib/advantage/modules/SLAdvListener.sleela)

SLAdvListener interface

Advantage listener contract: a user program implements this to be called when a

Methods — the actions this unit can perform.

MethodSignatureWhat it does
onMessageint onMessage(SLAdvMessage m);No description in source.

SLAdvMedium #sleela 3.0 (lib/advantage/modules/SLAdvMedium.sleela)

SLAdvMedium class

The Advantage medium: the middle, the center a user defined program loads.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
brSLAdvBridge brThe program loads the medium (the center). The medium owns the bridge and holds up to 16 modules. A module comes from the catalog by name (load) or from the program itself (attach). pump routes every pending message. Reserved names: program and medium. Messages to an unknown module get an error reply. A pump handles at most 100000 messages, so a ping-pong between modules cannot hang the program (saturated reports it).
catSLAdvCatalog catNo description in source.
listenerSLAdvListener listenerNo description in source.
modsSLAdvModule[] modsNo description in source.
namesString[] namesNo description in source.
nint n = 0No description in source.
maxModulesint maxModules = 16No description in source.
upboolean up = falseNo description in source.
saturatedboolean saturated = falseNo description in source.
routedint routed = 0No description in source.
unknownint unknown = 0No description in source.
failuresint failures = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
beginboolean begin()No description in source.
isUpboolean isUp()No description in source.
bridgeSLAdvBridge bridge()No description in source.
catalogSLAdvCatalog catalog()No description in source.
countint count()No description in source.
getRoutedint getRouted()No description in source.
getUnknownint getUnknown()No description in source.
getFailuresint getFailures()No description in source.
wasSaturatedboolean wasSaturated()No description in source.
nameAtString nameAt(int i)No description in source.
indexOfint indexOf(String name)No description in source.
hasboolean has(String name)No description in source.
findSLAdvModule find(String name)No description in source.
attachListenervoid attachListener(SLAdvListener l)No description in source.
attachboolean attach(SLAdvModule m)No description in source.
loadboolean load(String name)Load a catalog module by name and seat it. False when unknown or refused.
unloadboolean unload(String name)Unseat a module: it is ended and its slot closed up.
pumpModulesint pumpModules()No description in source.
deliverint deliver()No description in source.
pumpint pump()No description in source.
askSLAdvMessage ask(SLAdvMessage req)No description in source.
tellint tell(String toName, String topicName, String text)Send a request without waiting. Returns the id, or -1 when refused.
shutdownvoid shutdown()End every module and close the bridge.

SLAdvMessage #sleela 3.0 (lib/advantage/modules/SLAdvMessage.sleela)

SLAdvMessage class

The envelope that travels over the Advantage bridge, in either direction.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
idint id = 0kind: 0 request, 1 reply, 2 event, 3 error. status: 0 ok, nonzero refused. Reserved addresses: program is the user defined program, medium is the host.
inReplyToint inReplyTo = 0No description in source.
kindint kind = 0No description in source.
statusint status = 0No description in source.
fromString from = ""No description in source.
toString to = ""No description in source.
topicString topic = ""No description in source.
textString text = ""No description in source.
numsdouble[] numsNo description in source.
countint count = 0No description in source.
builtboolean built = falseNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
buildvoid build()No description in source.
capacityint capacity()No description in source.
sizeint size()No description in source.
addressedSLAdvMessage addressed(String fromName, String toName, String topicName, int kindCode)Address the message. Returns itself so a call can be chained.
withTextSLAdvMessage withText(String t)No description in source.
setNumboolean setNum(int i, double v)Set number i (0..47). An out of range index is refused (false).
numdouble num(int i)Read number i; out of range reads as 0.0.
numbersdouble[] numbers()No description in source.
makeReplySLAdvMessage makeReply(String fromName, String topicName)No description in source.
makeErrorSLAdvMessage makeError(String fromName, int code, String why)No description in source.

SLAdvModule #sleela 3.0 (lib/advantage/modules/SLAdvModule.sleela)

SLAdvModule interface

Advantage module contract: what any module must offer to sit in the medium.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
moduleNameString moduleName();No description in source.
moduleKindString moduleKind();No description in source.
moduleVersionString moduleVersion();No description in source.
beginboolean begin(SLAdvBridge bridge);No description in source.
handleint handle(SLAdvMessage m);No description in source.
endvoid end();No description in source.
runningboolean running();No description in source.

SLAdvMoralModule #sleela 3.0 (lib/advantage/modules/moral/SLAdvMoralModule.sleela)

SLAdvMoralModule class

The Moral Evaluator as an Advantage module (loaded by name moral-evaluator).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
evSLMoralEvaluator evWire layout. configure: n0 points 5..41, n1 verdict states 2 or 3. register: n0 list (0 nouns, 1 names, 2 scientific, 3 moral), text is the entry. judge: n0..n31 trade facts in SLMoralTrade wire order; reply n0 verdict (0 NO, 1 YES, 2 COMPLETE), n1 merit, n2 risk, n3 cardinal point that failed or -1, n4 weak dimension or -1, n5 active points, text reason. review: n0 verdict that was given, n1 1 if it was right. ledger reply: n0 trades, n1 NO, n2 YES, n3 COMPLETE, n4 mean merit, n5 recent merit, n6 worst merit, n7 risk of merit. A cardinal veto also sends the program an unsolicited cardinal-veto event.
tsSLTallScience tsNo description in source.
ledSLMoralMeritLedger ledNo description in source.
brSLAdvBridge brNo description in source.
onboolean on = falseNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
moduleNameString moduleName()No description in source.
moduleKindString moduleKind()No description in source.
moduleVersionString moduleVersion()No description in source.
runningboolean running()No description in source.
beginboolean begin(SLAdvBridge bridge)No description in source.
endvoid end()No description in source.
failvoid fail(SLAdvMessage m, int code, String why)No description in source.
okReplySLAdvMessage okReply(SLAdvMessage m)No description in source.
handleint handle(SLAdvMessage m)No description in source.

SLAdvTraderModule #sleela 3.0 (lib/advantage/modules/trader/SLAdvTraderModule.sleela)

SLAdvTraderModule class

The high speed trader as an Advantage module (loaded by name high-speed-trader).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
trSLHighSpeedTrader trWire layout. configure: n0 pragmatics 8..24, n1 trades per minute. evaluate: n0..n9 candidate, n10 now in ms; reply n0 accepted 0 or 1, n1 code, n2 score, n3 threshold, n4 1 when sent to the linked module. simulate: n0 seconds (1..600), n1 seed; reply n0 evals, n1 accepted, n2 vetoed, n3 score rejects, n4 rate rejects, n5 pnl bps, n6 threshold, n7 halted. insight: n0 pragmatic id, n1 factor. link: text is the name of a module to judge each accepted trade. set-facts: n0..n31 trade facts template for judged trades. A judged reply returns here from the linked module; NO withdraws the trade, and the program is told by event.
mkSLHstMarket mkNo description in source.
brSLAdvBridge brNo description in source.
onboolean on = falseNo description in source.
linkedString linked = ""No description in source.
clockMsdouble clockMs = 0.0No description in source.
judgedint judged = 0No description in source.
keptint kept = 0No description in source.
withdrawnint withdrawn = 0No description in source.
completeNint completeN = 0No description in source.
factsdouble[] factsNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
moduleNameString moduleName()No description in source.
moduleKindString moduleKind()No description in source.
moduleVersionString moduleVersion()No description in source.
runningboolean running()No description in source.
beginboolean begin(SLAdvBridge bridge)No description in source.
endvoid end()No description in source.
failvoid fail(SLAdvMessage m, int code, String why)No description in source.
okReplySLAdvMessage okReply(SLAdvMessage m)No description in source.
judgeFactsvoid judgeFacts(double[] o, SLAdvMessage j)---- candidate to trade facts for the linked judge ----
handleint handle(SLAdvMessage m)No description in source.
judgedReplyint judgedReply(SLAdvMessage m)---- the verdict comes back from the linked module ----

SLAnnouncementContact #sleela 3.0 (lib/advantage/physics/SLAnnouncementContact.sleela)

SLAnnouncementContact class

Announcements as boundary constraints on a contact manifold -- information topology of a declared economic space.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
axdouble ax---- 1-form alpha components (a_x, a_y, a_z) ----
aydouble ayNo description in source.
azdouble azNo description in source.
bxydouble bxy---- d(alpha) as a constant 2-form (b_xy, b_yz, b_zx) ----
byzdouble byzNo description in source.
bzxdouble bzxNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
standardFormvoid standardForm(double y)Standard announcement contact form alpha = dz - y dx, with the point's y supplied so a_x = -y. d(alpha) = dx ^ dy => (b_xy=1, b_yz=0, b_zx=0).
configurevoid configure(double axv, double ayv, double azv,Fully general linear form, for experimentation.
contactVolumedouble contactVolume()The coefficient of alpha ^ d(alpha) as a top 3-form (dx^dy^dz).
isContactboolean isContact(double tol)The contact condition alpha ^ d(alpha) != 0 holds (a genuine, non- integrable announced space where timing/sequence matter).
moveAllowedboolean moveAllowed(double vx, double vy, double vz, double tol)No description in source.
homotopyResidualdouble homotopyResidual(double credibility, double t)No description in source.
isNullboolean isNull(double credibility, double tol)An announcement is topologically null (fully deformable to hidden reality) when the residual can reach 0 within the deformation -- i.e. credibility is effectively 0. Returns true if the announcement carries no binding force.
describeString describe()No description in source.

SLBatchReturn #sleela 3.0 (lib/advantage/trading-actions-on-verb/SLBatchReturn.sleela)

SLBatchReturn class

Exact aggregate return over a stated batch of N independent trades: each trade re-stakes the same capital (no compounding), so total profit is simply summed, and the batch return is reported as an exact fraction (numerator/denominator in basis points) rather than a rounded percent.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
maxTradesint maxTrades = 2000000These three bounds are chosen TOGETHER so that EVERY product formed anywhere in this class stays at or below the exact-comparison limit 9,007,199,254,740,991 (2^53 - 1), proven once here rather than guarded ad hoc inside each method (an earlier version guarded the wrong product per call and both rejected some valid large-loss inputs AND still let a different product, in idealBatchReturnBp, silently overflow -- see use case 27's regression tests for both exact inputs that caught this): maxTrades * maxCapital * 10000 = 8,000,000,000,000,000 (<= the limit) -- this is the TIGHTEST bound: it is what idealBatchReturnBp needs to convert the largest possible profit into exact basis points. maxCapital * maxBp = 400,000,000,000 (<= the limit) maxTrades * maxCapital = 800,000,000,000 (<= the limit) maxBp = 1,000,000 bp is a 100x move per trade, already far above the largest multiple used anywhere else in this folder (12x, use case 6). maxCapital is modest (400,000 cents = $4,000) because this class must support up to maxTrades trades AND exact basis-point conversion of the resulting total; a single-trade class (SLLongBook) can and does allow far larger capital because it never multiplies a profit by 10000.
maxBpint maxBp = 1000000No description in source.
maxCapitalint maxCapital = 400000No description in source.
maxExplicitCapitalint maxExplicitCapital = 14000000000---- Explicit batch: up to 64 stated per-trade percent moves (bp), signed (a loss is a negative bp). Each trade re-stakes the same capital. ---- maxExplicitCapital is bounded so that 64 (the most trades this path can hold) * maxExplicitCapital * 10000 stays at or below the exact- comparison limit, the same product idealBatchReturnBp depends on above; this path allows a far larger per-trade capital than the idealized path because it is capped at 64 trades rather than maxTrades (2,000,000).
tradesint[] trades = new int[64]No description in source.
tradeCountint tradeCount = 0No description in source.
explicitCapitalint explicitCapital = 0No description in source.
explicitBatchValidboolean explicitBatchValid = falseNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
addTradeReasonString addTradeReason(int code)The reason addTrade refused, for the three codes it can return.
idealBatchInRangeboolean idealBatchInRange(int n, int capital, int winRateBp, int winBp, int lossBp)---- Idealized batch: winRate (bp of n), winBp, lossBp as percent moves --- True exactly when every input is in range and no internal product can pass maxCapital. Callers (and idealBatchReturnBp below) check this BEFORE reading idealBatchProfit, rather than inferring validity from the size of the returned profit: a real batch of up to maxTrades trades can legitimately lose up to maxTrades * maxCapital, which is far larger in magnitude than any single sentinel value could safely sit outside of, so no magnitude-based sentinel is used for this method's result. Checks only the four INPUT bounds. No further per-call overflow guard is needed: maxTrades, maxCapital and maxBp are chosen together (see their declaration above) so every product idealBatchProfit can form is already safe for any n, capital, winBp, lossBp within these four checks -- an earlier version re-derived an overflow guard per call and got it wrong (it rejected some valid, large-loss inputs as if they were out of range; see use case 27's regression test for the exact input that caught this).
idealBatchProfitint idealBatchProfit(int n, int capital, int winRateBp, int winBp, int lossBp)returns net profit, in capital units, for an idealized batch of n trades each re-staking `capital`. winRateBp is in basis points OF n (so 10000 bp = all wins). winBp/lossBp are the per-trade percent move in basis points (lossBp is given as a POSITIVE magnitude; it is subtracted). The caller MUST check idealBatchInRange first; this method trusts that check and does not itself distinguish "rejected" from "a real, large loss" in its return value (there is no safe sentinel for that -- see above).
idealBatchReturnBpint idealBatchReturnBp(int n, int capital, int winRateBp, int winBp, int lossBp)The batch return, in basis points of (n * capital), exact (floor). Returns -1 only for an out-of-range input (checked explicitly via idealBatchInRange, never inferred from the profit magnitude) or a zero stake; every in-range input returns its true signed basis-point value, however large the loss.
averagePerTradeBpint averagePerTradeBp(int totalReturnBp, int n)The exact per-trade AVERAGE return (in basis points) that an idealized batch implies, given its TOTAL return. This answers directly: "a batch return of X does not mean X per trade" -- it divides X by n, exactly, keeping the sign.
startExplicitBatchboolean startExplicitBatch(int capitalPerTrade)Result: false when capitalPerTrade is out of range (0 or above maxExplicitCapital); explicitBatchProfit/explicitBatchReturnBp return a sentinel (-1) in that case instead of computing with an unsafe capital.
addTradeint addTrade(int signedBp)Result codes: 0 accepted, 1 full (64 already recorded), 2 bp out of range.
explicitBatchProfitint explicitBatchProfit()Returns 0 (not a usable profit) when startExplicitBatch was never called successfully; callers should check explicitBatchValid or the return of startExplicitBatch before trusting this.
explicitBatchReturnBpint explicitBatchReturnBp()No description in source.
explicitTradeCountint explicitTradeCount()No description in source.
crossCheckOutcomeint crossCheckOutcome()A single share at a high price keeps the cent-level bp arithmetic exact; splitting capital across many low-priced shares would floor small moves to zero cents, as it does in SLLongBook itself (integer cents).
crossCheckAgainstLongBookboolean crossCheckAgainstLongBook()Convenience wrapper: true only when the real check ran AND matched.

SLBilateralNewsvendor #sleela 3.0 (lib/advantage/math/SLBilateralNewsvendor.sleela)

SLBilateralNewsvendor class

Bilateral newsvendor -- overage/underage costs on both ends and the centralized critical ratio that avoids double marginalization.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
overageSellerdouble overageSeller(double cs, double vs)---- Per-side overage and underage costs ----
underageSellerdouble underageSeller(double price, double cs)No description in source.
overageBuyerdouble overageBuyer(double price, double vb)No description in source.
underageBuyerdouble underageBuyer(double r, double price)No description in source.
criticalRatiodouble criticalRatio(double r, double cs, double vb)No description in source.
coordinationGapdouble coordinationGap(double r, double cs, double price, double vb)No description in source.
describeString describe(double r, double cs, double vb)No description in source.

SLCashflow #sleela 3.0 (lib/advantage/network/SLCashflow.sleela)

SLCashflow class

The engineering grease of a single trade -- MONEY IN, a TRADE, TIME, and CASH FLOW OUT as a receipt. It records cash deployed, units moved, the clearing price, holding time, and per-step frictions (fees, carry), then computes net proceeds, profit, return-on-capital and a simple time-annualized rate so one trade can be compared against another.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
unitsdouble units = 0.0---- Trade ledger ----
buyPricedouble buyPrice = 0.0No description in source.
sellPricedouble sellPrice = 0.0No description in source.
daysdouble days = 0.0No description in source.
feeRatedouble feeRate = 0.0No description in source.
carryPerUnitDaydouble carryPerUnitDay = 0.0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(double u, double buy, double sell, double d)No description in source.
setFrictionsvoid setFrictions(double fee, double carry)No description in source.
moneyIndouble moneyIn()MONEY IN: capital deployed to acquire the units.
grossdouble gross()Gross cash returned on the sale, before frictions.
feesdouble fees()Total venue + settlement fees across both legs.
carrydouble carry()TIME cost: carry (storage / financing) over the holding period.
cashOutdouble cashOut()CASH FLOW OUT: the net receipt after fees and carry.
profitdouble profit()Net profit on the round trip.
returnOnCapitaldouble returnOnCapital()Return on capital, as a fraction of money in.
annualizedRatedouble annualizedRate()Simple time-annualized rate: roc scaled linearly to 365 days.
receiptString receipt(String good)No description in source.

SLClockConnector #sleela 3.0 (lib/advantage/connect/SLClockConnector.sleela)

SLClockConnector class

The national-clock / NTP connector of the CONNECT medium. It models a disciplined time source: a named authority (e.g. a national metrology institute time service), an NTP stratum, a clock offset estimate, and a validity window. The live sync defers to a host adapter (slntp_*).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
vocabSLConnectStatus vocab---- Shared medium plumbing ----
faultSLConnectFault faultNo description in source.
authorityString authority = ""---- Clock state ----
configuredboolean configured = falseNo description in source.
openboolean open = falseNo description in source.
syncedboolean synced = falseNo description in source.
offsetMillisdouble offsetMillis = 0.0last estimated offset (local - true) in milliseconds
stratumint stratum = 16NTP stratum of the authority (1 best; 16 unsynchronized)
syncCountint syncCount = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
initvoid init()No description in source.
configureint configure(String authorityHost)No description in source.
openLinkint openLink()No description in source.
syncint sync()No description in source.
acceptSyncint acceptSync(double offset, int str)Host-adapter callback: record a measured discipline result.
disciplinedouble discipline(double localEpochMillis)Correct a local epoch-millis reading by the last measured offset.
trustedboolean trusted(int stratumCeiling)True when the authority is trustworthy enough to rely on (synced and a stratum at or below the accepted ceiling).
closeLinkint closeLink()No description in source.
activeboolean active()No description in source.
isSyncedboolean isSynced()No description in source.
getStratumint getStratum()No description in source.
getOffsetMillisdouble getOffsetMillis()No description in source.
isNativeReadyboolean isNativeReady()No description in source.
lastFaultSLConnectFault lastFault()No description in source.
describeString describe()No description in source.

SLCompartment #sleela 3.0 (lib/advantage/integration/SLCompartment.sleela)

SLCompartment class

The recursive compartment -- the self-similar building block of a vertical-integration model.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
labelString label---- Identity & kind ----
kindint kindNo description in source.
meaningString meaningNo description in source.
relevanceint relevanceNo description in source.
capacityint capacity---- Capacitive space ----
usedint usedNo description in source.
childrenSLCompartment[] children---- Recursive children (its own model) ----
childCountint childCountNo description in source.
childCapint childCapNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String lbl, int k, SLIntegrationKind cat)Configure from a kind, using SLIntegrationKind for defaults.
getLabelString getLabel()No description in source.
getKindint getKind()No description in source.
getMeaningString getMeaning()No description in source.
getRelevanceint getRelevance()No description in source.
getCapacityint getCapacity()No description in source.
getUsedint getUsed()No description in source.
setCapacityvoid setCapacity(int c)No description in source.
setMeaningvoid setMeaning(String m)No description in source.
setRelevancevoid setRelevance(int r)No description in source.
freeint free()Free space remaining in this compartment's own capacitive space.
storeint store(int amount)Fill `amount` units if they fit; returns the amount actually stored.
releaseint release(int amount)Release `amount` units; returns the amount actually released.
addChildvoid addChild(SLCompartment c)---- Recursion: nest a child compartment (its own model) ----
getChildCountint getChildCount()No description in source.
childAtSLCompartment childAt(int i)No description in source.
subtreeSizeint subtreeSize()Total compartments in this subtree, including self (recursive count).
depthint depth()Maximum nesting depth of this subtree (self = depth 1).
totalCapacityint totalCapacity()Aggregate capacity of this subtree (self + all descendants).
totalUsedint totalUsed()Aggregate used units of this subtree.
totalRelevanceint totalRelevance()Sum of relevance across this subtree -- a crude "value density".
describeString describe()No description in source.

SLConnectFault #sleela 3.0 (lib/advantage/connect/SLConnectFault.sleela)

SLConnectFault class

A structured fault record for the CONNECT medium -- the library-idiomatic stand-in for an exception. Every connector records its last fault here (code, subsystem, operation, human message, retryable flag, attempt count) so a caller can inspect, log, and decide to retry without the language-level try/catch machinery.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
codeint code = 0---- Fault fields ----
subsystemString subsystem = "none"No description in source.
operationString operation = "none"No description in source.
messageString message = ""No description in source.
retryableboolean retryable = falseNo description in source.
attemptsint attempts = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
clearvoid clear()Reset to a clean, no-fault state.
raisevoid raise(SLConnectStatus vocab, int c, String sub, String op, String msg)Record a fault. The SLConnectStatus is supplied so name/transience render consistently without a cross-class static reference.
setRetryablevoid setRetryable(boolean r)Let a connector override retryability for domain reasons (e.g. a money DECLINED must never be retried automatically).
isFaultedboolean isFaulted()No description in source.
getCodeint getCode()No description in source.
getSubsystemString getSubsystem()No description in source.
getOperationString getOperation()No description in source.
getMessageString getMessage()No description in source.
isRetryableboolean isRetryable()No description in source.
getAttemptsint getAttempts()No description in source.
describeString describe(SLConnectStatus vocab)No description in source.

SLConnectStatus #sleela 3.0 (lib/advantage/connect/SLConnectStatus.sleela)

SLConnectStatus class

The universal status vocabulary for the advantage CONNECT medium -- the single set of integer outcome codes shared by every connector (SQL, clock, network, money). Status codes, not exceptions, are the library-wide error convention; this class names them and renders them.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
STATUS_OKstatic final int STATUS_OK = 0No description in source.
STATUS_INVALID_ARGUMENTstatic final int STATUS_INVALID_ARGUMENT = 1No description in source.
STATUS_INVALID_STATEstatic final int STATUS_INVALID_STATE = 2No description in source.
STATUS_NOT_CONFIGUREDstatic final int STATUS_NOT_CONFIGURED = 3No description in source.
STATUS_UNAUTHORIZEDstatic final int STATUS_UNAUTHORIZED = 4No description in source.
STATUS_TIMEOUTstatic final int STATUS_TIMEOUT = 5No description in source.
STATUS_UNREACHABLEstatic final int STATUS_UNREACHABLE = 6No description in source.
STATUS_PROTOCOLstatic final int STATUS_PROTOCOL = 7No description in source.
STATUS_DECLINEDstatic final int STATUS_DECLINED = 8No description in source.
STATUS_NATIVE_ADAPTER_REQUIREDstatic final int STATUS_NATIVE_ADAPTER_REQUIRED = 9No description in source.
STATUS_INTERNALstatic final int STATUS_INTERNAL = 10No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
okint ok()Accessor methods so other connectors read codes without cross-class static references (which the semantic checker rejects).
invalidArgumentint invalidArgument()No description in source.
invalidStateint invalidState()No description in source.
notConfiguredint notConfigured()No description in source.
unauthorizedint unauthorized()No description in source.
timeoutint timeout()No description in source.
unreachableint unreachable()No description in source.
protocolint protocol()No description in source.
declinedint declined()No description in source.
nativeAdapterRequiredint nativeAdapterRequired()No description in source.
internalint internal()No description in source.
isOkboolean isOk(int code)No description in source.
isTransientboolean isTransient(int code)No description in source.
nameString name(int code)No description in source.

SLDailyCapBook #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/SLDailyCapBook.sleela)

SLDailyCapBook class

A long-only FIFO position book, the same shape as SLLongBook, with one added rule: a single day may record at most 2,000 actions (buy, sell, hold or flatten calls that reach the quantity/price/fee checks).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
dailyCapint dailyCap = 2000No description in source.
maxQtyint maxQty = 100000000No description in source.
maxPriceint maxPrice = 10000000No description in source.
maxFeeint maxFee = 100000000No description in source.
maxTotalint maxTotal = 4000000000000000No description in source.
maxDayint maxDay = 10000000No description in source.
lotQtyint[] lotQty = new int[16]No description in source.
lotPriceint[] lotPrice = new int[16]No description in source.
lotDayint[] lotDay = new int[16]No description in source.
countint count = 0No description in source.
lastDayint lastDay = 0No description in source.
boughtQtyint boughtQty = 0No description in source.
soldQtyint soldQty = 0No description in source.
boughtCostint boughtCost = 0No description in source.
costSoldint costSold = 0No description in source.
proceedsTotalint proceedsTotal = 0No description in source.
feesPaidint feesPaid = 0No description in source.
lastSaleCostint lastSaleCost = 0No description in source.
lastSalePnlint lastSalePnl = 0No description in source.
actionsTodayint actionsToday = 0How many actions (of any verb) have been recorded on lastDay so far.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
maxLotsint maxLots()No description in source.
reasonString reason(int code)No description in source.
totalQtyint totalQty()No description in source.
costBasisint costBasis()No description in source.
avgCostFloorint avgCostFloor()No description in source.
avgCostRemainderint avgCostRemainder()No description in source.
lotCountint lotCount()No description in source.
lotQtyAtint lotQtyAt(int i)No description in source.
lotPriceAtint lotPriceAt(int i)No description in source.
lotDayAtint lotDayAt(int i)No description in source.
currentDayint currentDay()No description in source.
actionsOnCurrentDayint actionsOnCurrentDay()No description in source.
remainingTodayint remainingToday()No description in source.
admitActionboolean admitAction(int day)Call once per verb, after the day is known valid (not backwards) but before anything else changes. On a new day the counter resets to 0. Returns true when the action may proceed, false when the cap refuses it.
buyint buy(int day, int qty, int price, int fee)No description in source.
sellint sell(int day, int qty, int price, int fee)No description in source.
holdint hold(int day)No description in source.
flattenint flatten(int day, int price, int fee)No description in source.
compactvoid compact()No description in source.
realizedGrossint realizedGross()No description in source.
realizedNetint realizedNet()No description in source.
feesint fees()No description in source.
invariantsHoldboolean invariantsHold()No description in source.

SLDailyCapShortBook #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/SLDailyCapShortBook.sleela)

SLDailyCapShortBook class

A short-only FIFO position book, the same shape as SLShortBook, with one added rule: a single day may record at most 2,000 actions (shortSell, cover, hold or coverAll calls that reach the quantity/price/fee checks).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
maxQtyint maxQty = 100000000No description in source.
maxPriceint maxPrice = 10000000No description in source.
maxFeeint maxFee = 100000000No description in source.
maxTotalint maxTotal = 4000000000000000No description in source.
maxDayint maxDay = 10000000No description in source.
maxRateint maxRate = 1000No description in source.
dailyCapint dailyCap = 2000No description in source.
lotQtyint[] lotQty = new int[16]No description in source.
lotPriceint[] lotPrice = new int[16]No description in source.
lotDayint[] lotDay = new int[16]No description in source.
countint count = 0No description in source.
lastDayint lastDay = 0No description in source.
openedQtyint openedQty = 0No description in source.
coveredQtyint coveredQty = 0No description in source.
openedProceedsint openedProceeds = 0No description in source.
proceedsCoveredint proceedsCovered = 0No description in source.
coverCostint coverCost = 0No description in source.
feesPaidint feesPaid = 0No description in source.
borrowRateint borrowRate = 0No description in source.
borrowPaidint borrowPaid = 0No description in source.
lastCoverProceedsint lastCoverProceeds = 0No description in source.
lastCoverPnlint lastCoverPnl = 0No description in source.
actionsTodayint actionsToday = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
maxLotsint maxLots()No description in source.
reasonString reason(int code)No description in source.
totalShortint totalShort()No description in source.
proceedsHeldint proceedsHeld()No description in source.
avgSaleFloorint avgSaleFloor()No description in source.
avgSaleRemainderint avgSaleRemainder()No description in source.
lotCountint lotCount()No description in source.
lotQtyAtint lotQtyAt(int i)No description in source.
lotPriceAtint lotPriceAt(int i)No description in source.
lotDayAtint lotDayAt(int i)No description in source.
currentDayint currentDay()No description in source.
actionsOnCurrentDayint actionsOnCurrentDay()No description in source.
remainingTodayint remainingToday()No description in source.
admitActionboolean admitAction(int day)No description in source.
setBorrowRateint setBorrowRate(int rate)No description in source.
shortSellint shortSell(int day, int qty, int price, int fee)No description in source.
coverint cover(int day, int qty, int price, int fee)No description in source.
holdint hold(int day)No description in source.
coverAllint coverAll(int day, int price, int fee)No description in source.
compactvoid compact()No description in source.
realizedGrossint realizedGross()No description in source.
realizedNetint realizedNet()No description in source.
feesint fees()No description in source.
borrowCostPaidint borrowCostPaid()No description in source.
invariantsHoldboolean invariantsHold()No description in source.

SLDecisionDesk #sleela 3.0 (lib/advantage/learner-vs-professional/series/SLDecisionDesk.sleela)

SLDecisionDesk class

Shared desk for the trading-decision lessons: the Purchase Master runs the Sequitur onion, the student totals registered entries, and the desk compares them entry by entry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
fieldNameString fieldName = ""No description in source.
nint n = 0No description in source.
namesString[] names = new String[8]No description in source.
qint[] q = new int[8]No description in source.
fint[] f = new int[8]No description in source.
dint[] d = new int[8]No description in source.
sregSLNounRegistry sreg = new SLNounRegistry()No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
setupvoid setup(String fieldLabel)No description in source.
addOptionvoid addOption(String name, int quote, int fee, int discount)No description in source.
masterTotalint masterTotal(int i)The Purchase Master: one option through the advantage onion.
keepFirstboolean keepFirst(int a, int b)The tie norm: the first option stays unless the second is strictly cheaper.
masterPickint masterPick()No description in source.
buildStudentvoid buildStudent(int kind, int k)The student: register the entries, with one slip of the given kind at option k. Entry names are the option name plus quote, fee or discount.
studentTotalint studentTotal(int i)Student total for an option, or -1 when the student did not observe it.
studentPickint studentPick()No description in source.
pickNameString pickName(int i)No description in source.
checkEntryint checkEntry(String entry, String owner, boolean masterHas, int mv)Compare one entry: present, carrier and value. Returns 1 when it differs.
compareint compare()Prints every differing entry and returns how many there are.
showMastervoid showMaster()No description in source.
showStudentvoid showStudent()No description in source.
verdictboolean verdict()No description in source.
slipWordsString slipWords(int kind, int k)No description in source.
decidevoid decide(String title, int kind, int k)Runs one full decision: master, first student pass, and if needed the re-observation and a second comparison.

SLEngineeringBay #sleela 3.0 (lib/advantage/integration/SLEngineeringBay.sleela)

SLEngineeringBay class

Engineering bay -- a medium-capacity build/process compartment for the vertical-integration subject.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
spaceSLCompartment spaceNo description in source.
yieldPctint yieldPctyield as a percentage 0..100: output = input * yield / 100
producedTotalint producedTotalNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String lbl, SLIntegrationKind cat, int yieldPercent)No description in source.
getSpaceSLCompartment getSpace()No description in source.
getYieldint getYield()No description in source.
getProducedTotalint getProducedTotal()No description in source.
loadint load(int units)Load raw input into the bay's capacitive space; returns units accepted.
buildint build(int batch)Run a build: consume up to `batch` loaded units, emit output at the yield. Returns the output units produced; the consumed input leaves the bay.
freeSpaceint freeSpace()No description in source.
describeString describe()No description in source.

SLEuclid #sleela 3.0 (lib/advantage/trading-actions-on-verb/SLEuclid.sleela)

SLEuclid class

Careful integer Euclidean toolkit: greatest common divisor by Euclid loop, Bezout coefficients, exact fills by two round lots in logarithmic time, and squared Euclidean distance with an exact integer square root.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
maxDiffint maxDiff = 10000000Largest absolute coordinate difference accepted by distSq.
maxDimint maxDim = 64Largest dimension accepted. maxDiff squared times maxDim = 6.4e15 <= maxExact.
maxExactint maxExact = 9007199254740991The largest magnitude that every comparison handles exactly (2^53 - 1).
maxLotint maxLot = 90000000Largest lot size accepted by the fill routines: maxLot squared <= maxExact.
maxOrderint maxOrder = 1000000000000Largest order accepted by the fill routines.
maxMagint maxMag = 9007199254740991Largest value lcm may return.
sqrtCapint sqrtCap = 94906265Largest k with k*k <= maxExact; the search for a floor root never goes above.
stepsint steps = 0Number of loop passes taken by the last gcd call.
trailString trail = ""The remainder trail of the last gcd call, for example 120,180 -> 180,120
bxint bx = 0Bezout coefficients from the last egcd call: a*bx + b*by = g.
byint by = 0No description in source.
fillAint fillA = 0The fill found by canFill or canFillScan: fillA lots of a plus fillB of b.
fillBint fillB = 0No description in source.
fillStatusint fillStatus = 10 = a fill exists, 1 = no fill exists, 2 = input out of range.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
absint abs(int v)No description in source.
gcdint gcd(int a, int b)Greatest common divisor of |a| and |b|. gcd(0, 0) is 0. Returns -1 when either magnitude passes maxExact.
gcdAllint gcdAll(int[] v, int n)GCD of the first n values of v. Returns 0 when n is 0 or all are 0.
lcmint lcm(int a, int b)Least common multiple, or -1 when the result would pass maxMag.
egcdint egcd(int a, int b)Extended Euclid for 0 <= a, b <= maxExact. Returns g and sets bx, by so that a*bx + b*by = g. Returns -1 for an input outside that range.
bezoutHoldsboolean bezoutHolds(int a, int b, int g)No description in source.
fillInRangeboolean fillInRange(int c, int a, int b)No description in source.
canFillboolean canFill(int c, int a, int b)True when c shares can be filled exactly by whole lots of a and b. Solves a*x + b*y = c with x, y >= 0 and the smallest x. With g = gcd(a,b), a' = a/g, b' = b/g, c' = c/g: a solution needs g | c, then x = (c' mod b') * inverse(a' mod b') mod b', y = (c - a*x) / b, and it exists exactly when y >= 0. Every product is at most maxLot^2 = 8.1e15 <= maxExact.
canFillScanboolean canFillScan(int c, int a, int b)Reference implementation by scanning a-lot counts 0, 1, 2, ... Runs at most c / a + 1 passes. Used to cross-check canFill, not for large orders.
isqrtint isqrt(int n)Floor of the square root of n for 0 <= n <= maxExact, else -1. sqrtCap^2 <= maxExact < (sqrtCap + 1)^2, so mid*mid is always compared exactly.
distSqAtint distSqAt(int[] a, int oa, int[] b, int ob, int dim)Squared Euclidean distance between the first dim entries of a and b (a and b start at offsets oa and ob). Returns -1 when dim is out of range or any difference passes maxDiff.
distSqint distSq(int[] a, int[] b, int dim)No description in source.
distint dist(int[] a, int[] b, int dim)Floor of the Euclidean distance, or -1 on a rejected input.
nearestIndexint nearestIndex(int[] cur, int[] targets, int dim, int count)Index of the target nearest to cur. Targets are stored one after another in a flat array, dim entries each. A tie goes to the earlier target (the repo tie norm). Returns -1 when count < 1 or any distance is rejected.

SLGradeBook #sleela 3.0 (lib/advantage/grading/SLGradeBook.sleela)

SLGradeBook class

The grade book -- the top-level face of the sophistication circuit grader, producing ratings for each module and every set.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
circuitSLSophisticationCircuit circuitNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(SLSophisticationCircuit c)No description in source.
getCircuitSLSophisticationCircuit getCircuit()No description in source.
allSLGradeSet all()---- Set accessors (each an SLGradeSet with its own rating) ----
winningSLGradeSet winning()No description in source.
losingSLGradeSet losing()No description in source.
gradersSLGradeSet graders()No description in source.
absolutesSLGradeSet absolutes()No description in source.
overallTierint overallTier()Overall field tier 1..10 (the rating of the whole collection).
overallLetterString overallLetter()No description in source.
winRateint winRate()Win rate as a percentage: winning modules over all modules.
rateSetString rateSet(SLGradeSet s)Rating of an arbitrary externally-supplied set, so callers can grade "any set of modules" they assemble themselves, not just the circuit's.
championRatingString championRating()The champion module's rating, or "none" if the field is empty.
describeString describe()No description in source.
emitThroughvoid emitThrough(SLAdvantageEmitter em)Report the whole gradebook through an output emitter (terminal / commonrails / socket / silent); the sink decides the destination.

SLGradeSet #sleela 3.0 (lib/advantage/grading/SLGradeSet.sleela)

SLGradeSet class

A named set of graded modules (e.g. winning / losing / grader / absolute) with its own aggregate rating.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
nameString nameNo description in source.
gradesSLModuleGrade[] gradesNo description in source.
countint countNo description in source.
capint capNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String nm, int capacity)No description in source.
getNameString getName()No description in source.
sizeint size()No description in source.
addvoid add(SLModuleGrade g)No description in source.
atSLModuleGrade at(int i)No description in source.
totalScoreint totalScore()No description in source.
meanScoreint meanScore()Mean score (integer; 0 if empty).
bestScoreint bestScore()No description in source.
worstScoreint worstScore()No description in source.
tierint tier()Set-level tier 1..10 from the mean score (same scale as a module).
letterString letter()No description in source.
describeString describe()No description in source.

SLHighSpeedTrader #sleela 3.0 (lib/advantage/modules/trader/SLHighSpeedTrader.sleela)

SLHighSpeedTrader class

The high speed trader AI built from 8 to 24 pragmatics (pure computation, synthetic data).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
regSLHstPragmatics regThe high speed trader: a pure-computation model (no orders, no network). Candidate layout o[0..9]: edgeBps, costBps, evidenceN, spreadBps, volBps, ageMs, qty (fraction of max order, 0 to 1), positionFrac (0 to 1), venueTrust (0 to 1), depthRatio (depth divided by qty). Pipeline per candidate: 24 features in 0..1, then the first P pragmatics by priority order. Any feature below its hard minimum is a veto. Else the weighted score must reach the threshold and the rate governor must have a token. Everything fails closed: not ready, halted, or malformed means no.
fdouble[] fNo description in source.
wdouble[] wNo description in source.
hmdouble[] hmNo description in source.
orderint[] orderNo description in source.
vetoCountint[] vetoCountNo description in source.
priordouble[] priorNo description in source.
Pint P = 8No description in source.
readyboolean ready = falseNo description in source.
haltedboolean halted = falseNo description in source.
thresholddouble threshold = 0.60No description in source.
tradesPerMinutedouble tradesPerMinute = 2000.0No description in source.
ratePerMsdouble ratePerMs = 0.0No description in source.
burstdouble burst = 8.0No description in source.
tokensdouble tokens = 8.0No description in source.
lastMsdouble lastMs = -1.0No description in source.
windowStartdouble windowStart = 0.0No description in source.
windowAcceptedint windowAccepted = 0No description in source.
windowRateRejint windowRateRej = 0No description in source.
evalsint evals = 0No description in source.
acceptedint accepted = 0No description in source.
rejVetoint rejVeto = 0No description in source.
rejScoreint rejScore = 0No description in source.
rejRateint rejRate = 0No description in source.
rejNotReadyint rejNotReady = 0No description in source.
lastCodeint lastCode = 1No description in source.
lastBucketint lastBucket = 0No description in source.
insightsint insights = 0No description in source.
insightsRefusedint insightsRefused = 0No description in source.
lastScoredouble lastScore = 0.0No description in source.
pnldouble pnl = 0.0No description in source.
peakdouble peak = 0.0No description in source.
ddLimitdouble ddLimit = 400.0No description in source.
etadouble eta = 0.10No description in source.
learningboolean learning = trueNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureboolean configure(int pragmatics, double tpm)No description in source.
setLearningvoid setLearning(boolean on)No description in source.
setDrawdownLimitboolean setDrawdownLimit(double lim)For comparison runs only: a positive finite drawdown limit in bps.
getPragmaticsint getPragmatics()No description in source.
getThresholddouble getThreshold()No description in source.
getEvalsint getEvals()No description in source.
getAcceptedint getAccepted()No description in source.
getRejVetoint getRejVeto()No description in source.
getRejScoreint getRejScore()No description in source.
getRejRateint getRejRate()No description in source.
getVetoint getVeto(int id)No description in source.
getWeightdouble getWeight(int id)No description in source.
getPnldouble getPnl()No description in source.
getLastCodeint getLastCode()No description in source.
getLastScoredouble getLastScore()No description in source.
isHaltedboolean isHalted()No description in source.
getInsightsint getInsights()No description in source.
getInsightsRefusedint getInsightsRefused()No description in source.
resetWindowAcceptedint resetWindowAccepted()No description in source.
clamp01double clamp01(double x)---- small numeric helpers ----
okvboolean okv(double x)No description in source.
haltNowvoid haltNow()---- human control: halt is instant, re-arm is a deliberate human act ----
rearmvoid rearm()No description in source.
insightboolean insight(int id, double factor)No description in source.
refillvoid refill(double nowMs)---- rate governor: token bucket plus a once a second threshold controller ----
featuresvoid features(double[] o)---- the 24 features, straight line, each in 0..1 where 1 is best ----
evaluateint evaluate(double[] o, double nowMs)No description in source.
learnvoid learn(double realizedBps)No description in source.

SLHstMarket #sleela 3.0 (lib/advantage/modules/trader/SLHstMarket.sleela)

SLHstMarket class

A deterministic synthetic market that feeds the high speed trader.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
seedint seed = 12345Deterministic synthetic candidate stream: same seed, same stream. Mix: noise, marginal, genuine, phantom (too good to be true), stale, oversize, high position, low trust, and a rare malformed record. The hidden truth decides the realized outcome, so learning has a signal.
realboolean real = falseNo description in source.
lastEdouble lastE = 0.0No description in source.
lastCdouble lastC = 0.0No description in source.
lastVdouble lastV = 0.0No description in source.
kindCountint kindCount = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
reseedvoid reseed(int s)No description in source.
lastWasRealboolean lastWasReal()No description in source.
rnddouble rnd()No description in source.
betweendouble between(double lo, double hi)No description in source.
nextvoid next(double[] o)Fill o[0..9] with the next candidate. o must have 10 elements.
realizeddouble realized()Realized outcome in bps of the candidate just generated, with noise.

SLHstPragmatics #sleela 3.0 (lib/advantage/modules/trader/SLHstPragmatics.sleela)

SLHstPragmatics class

The registry of the 24 pragmatics of the high speed trader AI.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
namesString[] namesids 0..7 LOGIC (clear logic), 8..15 USE (logic of use), 16..23 GROUND (secure and grounded trade). The priority order interleaves the phases so any prefix of 8 to 24 keeps all three, and the first 8 are the minimal safe core: every hard gate a trade must clear before it is even scored.
hardMinsdouble[] hardMinsNo description in source.
orderint[] orderNo description in source.
builtboolean built = falseNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
buildvoid build()No description in source.
countint count()No description in source.
minPragmaticsint minPragmatics()No description in source.
maxPragmaticsint maxPragmatics()No description in source.
nameString name(int id)No description in source.
hardMindouble hardMin(int id)No description in source.
orderAtint orderAt(int i)No description in source.
phaseString phase(int id)No description in source.

SLIntegrationKind #sleela 3.0 (lib/advantage/integration/SLIntegrationKind.sleela)

SLIntegrationKind class

The compartment-kind vocabulary for the vertical-integration subject -- the OOD catalog of compartment types, capacities, and meanings.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nameOfString nameOf(int kind)Human name of a kind id.
defaultCapacityClassint defaultCapacityClass(int kind)Default capacity class for a kind. Engineering bays are MEDIUM by design; nested models are recursive; onions and trays are small; plain holders are small by default (callers can resize).
capacityUnitsint capacityUnits(int capClass)Numeric capacity units implied by a capacity class.
meaningOfString meaningOf(int kind)Meaning: what this kind is FOR (one line).
relevanceOfint relevanceOf(int kind)Relevance: how this kind participates in the vertical value chain. A rough 1..10 weight used by the model to gauge system sophistication contribution.
isPlainboolean isPlain(int kind)No description in source.
isRecursiveboolean isRecursive(int kind)No description in source.

SLJointProfitMax #sleela 3.0 (lib/advantage/math/SLJointProfitMax.sleela)

SLJointProfitMax class

Joint Profit Maximization -- the integrated surplus formula for a coordinated buyer+seller system.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
rbAdouble rbA---- Curve coefficients ---- linear term of buyer revenue R_B(Q)
rbBdouble rbBquadratic (diminishing) term of buyer revenue
csAdouble csAlinear term of seller cost C_S(Q)
csBdouble csBquadratic (convex) term of seller cost

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureCurvesvoid configureCurves(double rbA0, double rbB0, double csA0, double csB0)No description in source.
getRbAdouble getRbA()No description in source.
getRbBdouble getRbB()No description in source.
getCsAdouble getCsA()No description in source.
getCsBdouble getCsB()No description in source.
buyerRevenuedouble buyerRevenue(double q)Buyer revenue / utility from Q units.
sellerCostdouble sellerCost(double q)Seller total cost for Q units.
jointProfitdouble jointProfit(double q)Total available pool of profit: Pi_total(Q) = R_B(Q) - C_S(Q).
marginalRevenuedouble marginalRevenue(double q)Marginal revenue dR_B/dQ.
marginalCostdouble marginalCost(double q)Marginal supply cost dC_S/dQ.
optimalQuantitydouble optimalQuantity()Optimal quantity Q* where MR = MC. 0 if no interior optimum exists.
maxJointProfitdouble maxJointProfit()The maximum joint surplus, evaluated at Q*.
describeString describe()No description in source.

SLLongBook #sleela 3.0 (lib/advantage/trading-actions-on-verb/SLLongBook.sleela)

SLLongBook class

A long-only position book of FIFO lots with verbs buy, sell, hold and flatten, integer cents, time in whole days, and invariants checked after every action.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
maxQtyint maxQty = 100000000Largest accepted quantity, price and fee; largest running total.
maxPriceint maxPrice = 10000000No description in source.
maxFeeint maxFee = 100000000No description in source.
maxTotalint maxTotal = 4000000000000000No description in source.
maxDayint maxDay = 10000000Largest day number accepted (about 27,000 years).
lotQtyint[] lotQty = new int[16]No description in source.
lotPriceint[] lotPrice = new int[16]No description in source.
lotDayint[] lotDay = new int[16]No description in source.
countint count = 0No description in source.
lastDayint lastDay = 0No description in source.
boughtQtyint boughtQty = 0No description in source.
soldQtyint soldQty = 0No description in source.
boughtCostint boughtCost = 0No description in source.
costSoldint costSold = 0No description in source.
proceedsTotalint proceedsTotal = 0No description in source.
feesPaidint feesPaid = 0No description in source.
lastSaleCostint lastSaleCost = 0Cost basis and pnl of the most recent sell, before fees.
lastSalePnlint lastSalePnl = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
maxLotsint maxLots()No description in source.
reasonString reason(int code)No description in source.
totalQtyint totalQty()No description in source.
costBasisint costBasis()Cost of what is still held, in cents.
avgCostFloorint avgCostFloor()Average cost per share, rounded down, and the leftover cents.
avgCostRemainderint avgCostRemainder()No description in source.
lotCountint lotCount()No description in source.
lotQtyAtint lotQtyAt(int i)No description in source.
lotPriceAtint lotPriceAt(int i)No description in source.
lotDayAtint lotDayAt(int i)No description in source.
currentDayint currentDay()No description in source.
buyint buy(int day, int qty, int price, int fee)No description in source.
sellint sell(int day, int qty, int price, int fee)Sell oldest lots first. Refuses, changing nothing, when the sell is not valid or exceeds the holding.
holdint hold(int day)Let time pass with no trade.
flattenint flatten(int day, int price, int fee)Sell everything that is held.
compactvoid compact()Remove emptied lots, keeping the rest in order.
realizedGrossint realizedGross()Realized profit before fees, over everything sold so far.
realizedNetint realizedNet()Realized profit after every fee paid so far, buys and sells.
feesint fees()No description in source.
validTodayboolean validToday(int today)True when today is not before the book day, so ages cannot be negative.
ageOfint ageOf(int i, int today)No description in source.
oldestAgeint oldestAge(int today)Age of the oldest lot in days, or -1 when flat or when today is invalid.
weightedAgeFloorint weightedAgeFloor(int today)Quantity-weighted average age in whole days, rounded down; 0 when flat, -1 when today is invalid.
qtyOlderThanint qtyOlderThan(int today, int maxAge)Shares held for more than maxAge days.
isLongTermboolean isLongTerm(int i, int today, int threshold)A lot is long term when it is held for MORE than threshold days.
qtyLongTermint qtyLongTerm(int today, int threshold)No description in source.
invariantsHoldboolean invariantsHold()---- Invariants ---- 1 every lot has positive quantity and price; 2 lot days never decrease and never pass the book day; 3 count is within the 16-lot capacity; 4 shares held = shares bought - shares sold; 5 cost held = cost bought - cost sold.

SLMarketScout #sleela 3.0 (lib/advantage/network/SLMarketScout.sleela)

SLMarketScout class

A deterministic market scout -- the OFFLINE stand-in for a live internet search of venue quotes for a single good. It holds a small table of (venue, bid, ask) rows and reports the best place to BUY (lowest ask) and the best place to SELL (highest bid), plus the cross-venue spread opportunity.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
goodString good---- Quote table: parallel arrays, up to 32 venues ----
venueString[] venue = new String[32]No description in source.
biddouble[] bid = new double[32]No description in source.
askdouble[] ask = new double[32]No description in source.
nint n = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
forGoodvoid forGood(String g)No description in source.
getGoodString getGood()No description in source.
countint count()No description in source.
addQuotevoid addQuote(String v, double b, double a)Append one venue's two-sided quote. bid = what they pay you to SELL to them; ask = what they charge you to BUY from them.
bidAtdouble bidAt(int i)No description in source.
askAtdouble askAt(int i)No description in source.
venueAtString venueAt(int i)No description in source.
bestAskIndexint bestAskIndex()Index of the lowest ask (cheapest place to BUY). -1 if empty.
bestBidIndexint bestBidIndex()Index of the highest bid (best place to SELL). -1 if empty.
bestAskdouble bestAsk()No description in source.
bestBiddouble bestBid()No description in source.
buyVenueString buyVenue()No description in source.
sellVenueString sellVenue()No description in source.
spreaddouble spread()No description in source.
describeString describe()No description in source.

SLModuleGrade #sleela 3.0 (lib/advantage/grading/SLModuleGrade.sleela)

SLModuleGrade class

One graded module -- a name, a raw sophistication score, a derived rating, and a role in the grading circuit.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
labelString label---- Module grade state ----
scoreint scoreNo description in source.
roleint roleNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
ROLE_NORMALint ROLE_NORMAL()role constants (methods cost no layout slot)
ROLE_GRADERint ROLE_GRADER()No description in source.
ROLE_ABSOLUTEint ROLE_ABSOLUTE()No description in source.
configurevoid configure(String lbl, int rawScore, int moduleRole)No description in source.
getLabelString getLabel()No description in source.
getScoreint getScore()No description in source.
setScorevoid setScore(int s)No description in source.
getRoleint getRole()No description in source.
setRolevoid setRole(int r)No description in source.
isGraderboolean isGrader()No description in source.
isAbsoluteboolean isAbsolute()No description in source.
tierint tier()Rating tier 1..10 from the raw score. Scores are clamped: a score of 100+ is a perfect 10, and every 10 points is one tier (floor at 1).
letterString letter()Letter rating from the tier. S is reserved for a perfect/elite tier.
describeString describe()No description in source.

SLMoneyConnector #sleela 3.0 (lib/advantage/connect/SLMoneyConnector.sleela)

SLMoneyConnector class

The money-source connector of the CONNECT medium -- banks and card networks. It models a payment lifecycle (authorize -> capture -> refund / void) against a funding source, validating amounts and state in the VM and deferring the live settlement to a host adapter (slbank_*). Declines are a first-class, non-retryable outcome.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
vocabSLConnectStatus vocab---- Shared medium plumbing ----
faultSLConnectFault faultNo description in source.
sourceKindString sourceKind = ""---- Funding-source + payment state ---- sourceKind: "bank" | "card" | "wallet"
keystoreAliasString keystoreAlias = ""No description in source.
currencyString currency = "USD"No description in source.
configuredboolean configured = falseNo description in source.
openboolean open = falseNo description in source.
authorizedCentsint authorizedCents = 0No description in source.
capturedCentsint capturedCents = 0No description in source.
refundedCentsint refundedCents = 0No description in source.
lastDeclinedboolean lastDeclined = falseNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
initvoid init()No description in source.
configureint configure(String kind, String alias, String cur)No description in source.
openLinkint openLink()No description in source.
authorizeint authorize(int amountCents)No description in source.
acceptAuthorizationint acceptAuthorization(int amountCents)Host-adapter callback: approval. Records the authorized hold.
declineAuthorizationint declineAuthorization(String why)Host-adapter callback: refusal. A decline is NOT retryable.
captureint capture(int amountCents)Capture against a prior authorization (native: slbank_capture). Cannot capture more than was authorized.
refundint refund(int amountCents)Refund part or all of what was captured (native: slbank_refund).
settledCentsint settledCents()Net settled amount after refunds, in cents.
closeLinkint closeLink()No description in source.
activeboolean active()No description in source.
wasDeclinedboolean wasDeclined()No description in source.
getAuthorizedCentsint getAuthorizedCents()No description in source.
getCapturedCentsint getCapturedCents()No description in source.
getRefundedCentsint getRefundedCents()No description in source.
isNativeReadyboolean isNativeReady()No description in source.
lastFaultSLConnectFault lastFault()No description in source.
receiptString receipt()A log-safe settlement receipt -- alias only, never a card number.
describeString describe()No description in source.

SLMoralEvaluator #sleela 3.0 (lib/advantage/modules/moral/SLMoralEvaluator.sleela)

SLMoralEvaluator class

The Moral Evaluator: up to 41 yes or no points, human and life centered.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
yesboolean[] yesThe Moral Evaluator. A trade is judged by up to 41 yes or no points in five dimensions: 0 trades, 1 time, 2 listers, 3 united states, 4 tall science. The orientation is the human at the center and the living person: five CARDINAL points (life safe, human is the end, informed consent, no deception, lawful subject) are vetoes that no amount of merit can buy. Verdicts: 0 NO, 1 YES, 2 COMPLETE (every one of the 41 points is yes). In binary mode COMPLETE is reported as YES. Fail closed: not ready is NO.
dimint[] dimNo description in source.
cardinalboolean[] cardinalNo description in source.
orderint[] orderNo description in source.
pnameString[] pnameNo description in source.
dimTotalint[] dimTotalNo description in source.
dimYesint[] dimYesNo description in source.
dimFracdouble[] dimFracNo description in source.
activeint active = 41No description in source.
modeint mode = 3No description in source.
readyboolean ready = falseNo description in source.
thresholddouble threshold = 0.80No description in source.
dimFloordouble dimFloor = 0.50No description in source.
lastMeritdouble lastMerit = 0.0No description in source.
lastVerdictint lastVerdict = 0No description in source.
lastCardinalFailint lastCardinalFail = -1No description in source.
lastWeakDimint lastWeakDim = -1No description in source.
lastReasonString lastReason = "not ready"No description in source.
reviewsint reviews = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureboolean configure(int points, int verdictStates)No description in source.
namesvoid names()No description in source.
getActiveint getActive()No description in source.
isReadyboolean isReady()No description in source.
getThresholddouble getThreshold()No description in source.
getMeritdouble getMerit()No description in source.
getRiskdouble getRisk()No description in source.
getVerdictint getVerdict()No description in source.
getReasonString getReason()No description in source.
getCardinalFailint getCardinalFail()No description in source.
getWeakDimint getWeakDim()No description in source.
getDimFracdouble getDimFrac(int d)No description in source.
getAnswerboolean getAnswer(int id)No description in source.
pointNameString pointName(int id)No description in source.
verdictNameString verdictName(int v)No description in source.
dimNameString dimName(int d)No description in source.
answersvoid answers(SLMoralTrade t, SLTallScience ts)---- the 41 yes or no answers, straight line ----
evaluateint evaluate(SLMoralTrade t, SLTallScience ts)No description in source.
reviewboolean review(int verdictWas, boolean correct)No description in source.

SLMoralMeritLedger #sleela 3.0 (lib/advantage/modules/moral/SLMoralMeritLedger.sleela)

SLMoralMeritLedger class

The ledger of verdicts and merit over many trades.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
countint count = 0Overall trades over time: a running record of verdicts and merit.
nNoint nNo = 0No description in source.
nYesint nYes = 0No description in source.
nCompleteint nComplete = 0No description in source.
sumMeritdouble sumMerit = 0.0No description in source.
emadouble ema = 0.0No description in source.
minMeritdouble minMerit = 1.0No description in source.
weakint[] weakNo description in source.
cardinalFailsint[] cardinalFailsNo description in source.
builtboolean built = falseNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
buildvoid build()No description in source.
noteTradevoid noteTrade(SLMoralEvaluator ev)No description in source.
getCountint getCount()No description in source.
getNoint getNo()No description in source.
getYesint getYes()No description in source.
getCompleteint getComplete()No description in source.
meanMeritdouble meanMerit()No description in source.
recentMeritdouble recentMerit()No description in source.
worstMeritdouble worstMerit()No description in source.
riskOfMeritdouble riskOfMerit()No description in source.
weakCountint weakCount(int d)No description in source.
cardinalCountint cardinalCount(int id)No description in source.

SLMoralTrade #sleela 3.0 (lib/advantage/modules/moral/SLMoralTrade.sleela)

SLMoralTrade class

The facts of one trade for the Moral Evaluator.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
endangersLifeboolean endangersLife = falseThe facts of one trade, set by the caller. Defaults describe an exemplary trade, so a test changes only the one fact it wants to break.
humanIsEndboolean humanIsEnd = trueNo description in source.
consentboolean consent = trueNo description in source.
deceptiveboolean deceptive = falseNo description in source.
coercedboolean coerced = falseNo description in source.
priceRatiodouble priceRatio = 1.0No description in source.
hasRemedyboolean hasRemedy = trueNo description in source.
thirdPartyHarmboolean thirdPartyHarm = falseNo description in source.
bothBenefitboolean bothBenefit = trueNo description in source.
exploitsUrgencyboolean exploitsUrgency = falseNo description in source.
coolingOffHoursdouble coolingOffHours = 24.0No description in source.
decisionMinutesdouble decisionMinutes = 30.0No description in source.
timestampedboolean timestamped = trueNo description in source.
termDaysdouble termDays = 30.0No description in source.
quoteAgeSecondsdouble quoteAgeSeconds = 5.0No description in source.
tradesPerMinutedouble tradesPerMinute = 100.0No description in source.
listerIdentifiedboolean listerIdentified = trueNo description in source.
listerStandingdouble listerStanding = 0.9No description in source.
listingTruthfulboolean listingTruthful = trueNo description in source.
listerProhibitedboolean listerProhibited = falseNo description in source.
provenanceKnownboolean provenanceKnown = trueNo description in source.
conflictDisclosedboolean conflictDisclosed = trueNo description in source.
listerCountint listerCount = 3No description in source.
listerAccountableboolean listerAccountable = trueNo description in source.
inUsBoundaryboolean inUsBoundary = trueNo description in source.
lawfulSubjectboolean lawfulSubject = trueNo description in source.
sanctionedCounterpartyboolean sanctionedCounterparty = falseNo description in source.
recordsKeptboolean recordsKept = trueNo description in source.
feesAccountedboolean feesAccounted = trueNo description in source.
manipulativeboolean manipulative = falseNo description in source.
protectionsHonoredboolean protectionsHonored = trueNo description in source.
respectsUSboolean respectsUS = trueNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
wireSizeint wireSize()No description in source.
fromNumsboolean fromNums(double[] n)No description in source.
toNumsboolean toNums(double[] n)No description in source.

SLNashBargaining #sleela 3.0 (lib/advantage/math/SLNashBargaining.sleela)

SLNashBargaining class

Bilateral monopoly & Nash bargaining -- split a known joint surplus by a bargaining-power index over reservation profits.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
curvesSLJointProfitMax curves---- Dependencies (sibling-linked within advantage/math) ----
mathlibSLTradeMath mathlibNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(SLJointProfitMax c)No description in source.
sellerProfitdouble sellerProfit(double price, double q)Seller profit at wholesale price P and quantity Q: (P*Q) - C_S(Q).
buyerProfitdouble buyerProfit(double price, double q)Buyer profit at wholesale price P and quantity Q: R_B(Q) - (P*Q).
nashObjectivedouble nashObjective(double price, double q, double s0, double b0, double alpha)The Nash objective at a candidate price. Both surpluses must be positive to be inside the bargaining range; outside it the objective is 0.
nashPricedouble nashPrice(double s0, double b0, double alpha)No description in source.
bargainableSurplusdouble bargainableSurplus(double s0, double b0)The joint surplus available for bargaining beyond both reservation points.
describeString describe(double s0, double b0, double alpha)No description in source.

SLNegotiationRound #sleela 3.0 (lib/advantage/network/SLNegotiationRound.sleela)

SLNegotiationRound class

The performant core of network negotiation. Given a buyer's maximum acceptable price (reservation) and a seller's minimum acceptable price, it finds the zone of possible agreement (ZOPA) and clears a single fair price inside it by a bargaining-power split -- a closed-form step with no search loop, so a whole fan of counterparties clears in O(parties).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
buyerMaxdouble buyerMax = 0.0No description in source.
sellerMindouble sellerMin = 0.0No description in source.
alphadouble alpha = 0.5No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(double sellerMin0, double buyerMax0, double alpha0)No description in source.
hasDealboolean hasDeal()Is there a zone of possible agreement at all?
zopadouble zopa()Width of the ZOPA (0 if none).
clearingPricedouble clearingPrice()The cleared fair price inside the ZOPA. 0 if no deal.
sellerSurplusdouble sellerSurplus()Surplus each side keeps at the cleared price.
buyerSurplusdouble buyerSurplus()No description in source.
describeString describe()No description in source.

SLNetConnector #sleela 3.0 (lib/advantage/connect/SLNetConnector.sleela)

SLNetConnector class

The network-connectivity connector of the CONNECT medium. It models reachability to an endpoint: open a link, probe reachability and latency, account bytes sent, and close. The live socket work defers to a host adapter (slnet_*), consistent with lib/advantage/output/SLAdvantageSink.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
vocabSLConnectStatus vocab---- Shared medium plumbing ----
faultSLConnectFault faultNo description in source.
hostString host = ""---- Endpoint state ----
portint port = 0No description in source.
configuredboolean configured = falseNo description in source.
openboolean open = falseNo description in source.
reachableboolean reachable = falseNo description in source.
lastRttMillisdouble lastRttMillis = 0.0No description in source.
bytesSentint bytesSent = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
initvoid init()No description in source.
configureint configure(String h, int p)No description in source.
openLinkint openLink()No description in source.
probeint probe()No description in source.
acceptProbeint acceptProbe(double rttMillis)Host-adapter callback: record a measured round-trip time.
writeint write(int count)Account bytes to write (native: slnet_write). Returns bytes accepted (0 if not open). The real send is a host-adapter responsibility.
closeLinkint closeLink()No description in source.
activeboolean active()No description in source.
isReachableboolean isReachable()No description in source.
getRttMillisdouble getRttMillis()No description in source.
getBytesSentint getBytesSent()No description in source.
isNativeReadyboolean isNativeReady()No description in source.
lastFaultSLConnectFault lastFault()No description in source.
endpointString endpoint()No description in source.
describeString describe()No description in source.

SLNewtonMedianTray #sleela 3.0 (lib/advantage/integration/SLNewtonMedianTray.sleela)

SLNewtonMedianTray class

Newton median tray -- a median-based enlightenment/insight compartment for the vertical-integration subject.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
spaceSLCompartment spaceNo description in source.
samplesint[] samplesNo description in source.
countint countNo description in source.
capint capNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String lbl, SLIntegrationKind cat, int maxSamples)No description in source.
getSpaceSLCompartment getSpace()No description in source.
getCountint getCount()No description in source.
addboolean add(int value)Add a measurement. Returns true if stored.
sortSamplesvoid sortSamples()Insertion sort of the first `count` samples (small trays).
medianint median()The median sample -- the enlightenment value. For an even count this returns the lower-middle of the two central values (integer convention). 0 if the tray is empty.
spreadint spread()Spread = max - min (0 if empty); a wide spread tempers confidence.
robustnessint robustness()Robustness score 1..10: more samples and a tighter spread -> higher. A crude heuristic for how trustworthy the median insight is.
describeString describe()No description in source.

SLNounRegistry #sleela 3.0 (lib/advantage/learner-vs-professional/series/SLNounRegistry.sleela)

SLNounRegistry class

Shared registry of nouns and noun-carriers inside one declared field of observation, used by every Device Instructor lesson.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
fieldString field = ""No description in source.
nounsString[] nouns = new String[32]No description in source.
carriersString[] carriers = new String[32]No description in source.
valuesint[] values = new int[32]No description in source.
countint count = 0No description in source.
acceptedint accepted = 0No description in source.
refusedint refused = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
declareFieldvoid declareField(String name)No description in source.
fieldNameString fieldName()No description in source.
sizeint size()No description in source.
acceptedCountint acceptedCount()No description in source.
refusedCountint refusedCount()No description in source.
nounAtString nounAt(int i)No description in source.
carrierAtString carrierAt(int i)No description in source.
indexOfint indexOf(String noun)Returns the index of a noun, or -1 when it is not registered.
hasboolean has(String noun)No description in source.
registerint register(String noun, String carrier)Result codes: 0 accepted, 1 field not declared, 2 noun already placed, 3 registry full, 4 carrier is neither the field nor a registered noun.
registerValueint registerValue(String noun, String carrier, int value)Registers a noun that also holds an integer value, for example cents.
reasonString reason(int code)No description in source.
carrierOfString carrierOf(String noun)The immediate carrier, or an empty string when the noun is not observed.
valueOfint valueOf(String noun)The stored value, or -1 when the noun is not observed. Use has() first when -1 could be a real value.
depthOfint depthOf(String noun)Number of hops from the noun up to the field, or -1 when not observed.
chainString chain(String noun)The chain from the noun up to the field, for example: order 2 -> order list -> customer-17 -> (field)
carriesint carries(String carrier)How many nouns this carrier holds directly.
totalUnderint totalUnder(String carrier)Sum of the values of every noun this carrier holds, directly or deeper.
isUnderboolean isUnder(String noun, String carrier)True when the carrier appears anywhere on the noun chain below the field.

SLPackage #sleela 3.0 (lib/advantage/SLPackage.sleela)

SLPackage class

Defines the SLeeLa standard-library package for advantage.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
packageNameString packageNameNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String name)No description in source.
nameString name()No description in source.
availableboolean available()No description in source.

SLPhysicsMath #sleela 3.0 (lib/advantage/physics/SLPhysicsMath.sleela)

SLPhysicsMath class

Self-contained real-valued helpers for the advantage/physics subject (sqrt, exp, ln), named distinctly from the math/ helper to avoid cross-directory class-name ambiguity.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
intToDdouble intToD(int n)No description in source.
expDdouble expD(double x)No description in source.
lnDdouble lnD(double y)No description in source.
powABdouble powAB(double a, double b)No description in source.
sqrtDdouble sqrtD(double a)No description in source.
absDdouble absD(double a)No description in source.

SLShortBook #sleela 3.0 (lib/advantage/trading-actions-on-verb/SLShortBook.sleela)

SLShortBook class

A short-only position book of FIFO lots with verbs shortSell, cover, hold and coverAll, integer cents, a per-share-per-day borrow cost, and invariants checked after every action.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
maxQtyint maxQty = 100000000No description in source.
maxPriceint maxPrice = 10000000No description in source.
maxFeeint maxFee = 100000000No description in source.
maxTotalint maxTotal = 4000000000000000No description in source.
maxDayint maxDay = 10000000No description in source.
maxRateint maxRate = 1000No description in source.
lotQtyint[] lotQty = new int[16]No description in source.
lotPriceint[] lotPrice = new int[16]No description in source.
lotDayint[] lotDay = new int[16]No description in source.
countint count = 0No description in source.
lastDayint lastDay = 0No description in source.
openedQtyint openedQty = 0No description in source.
coveredQtyint coveredQty = 0No description in source.
openedProceedsint openedProceeds = 0No description in source.
proceedsCoveredint proceedsCovered = 0No description in source.
coverCostint coverCost = 0No description in source.
feesPaidint feesPaid = 0No description in source.
borrowRateint borrowRate = 0No description in source.
borrowPaidint borrowPaid = 0No description in source.
lastCoverProceedsint lastCoverProceeds = 0Sale proceeds and profit of the most recent cover, before fees and borrow.
lastCoverPnlint lastCoverPnl = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
maxLotsint maxLots()No description in source.
reasonString reason(int code)No description in source.
totalShortint totalShort()No description in source.
proceedsHeldint proceedsHeld()Sale proceeds of the shares still short, in cents.
avgSaleFloorint avgSaleFloor()Average sale price per share still short, rounded down, and the remainder.
avgSaleRemainderint avgSaleRemainder()No description in source.
lotCountint lotCount()No description in source.
lotQtyAtint lotQtyAt(int i)No description in source.
lotPriceAtint lotPriceAt(int i)No description in source.
lotDayAtint lotDayAt(int i)No description in source.
currentDayint currentDay()No description in source.
setBorrowRateint setBorrowRate(int rate)The borrow rate can only change while nothing is short, so no share is ever charged at two rates.
shortSellint shortSell(int day, int qty, int price, int fee)No description in source.
coverint cover(int day, int qty, int price, int fee)Cover oldest lots first. Refuses, changing nothing, when the cover is not valid, exceeds the shares short, or would pass a size bound.
holdint hold(int day)No description in source.
coverAllint coverAll(int day, int price, int fee)No description in source.
compactvoid compact()No description in source.
realizedGrossint realizedGross()Profit on shares already covered, before fees and borrow cost.
realizedNetint realizedNet()Cash view: realizedGross - every fee paid - every borrow cost paid.
feesint fees()No description in source.
borrowCostPaidint borrowCostPaid()No description in source.
markToMarketint markToMarket(int price)Gain (positive) or loss (negative) on the shares still short if they were covered at price now: proceeds still held - shares short * price. Returns -(maxTotal + 1) when price is not between 1 and maxPrice.
validTodayboolean validToday(int today)No description in source.
ageOfint ageOf(int i, int today)No description in source.
oldestAgeint oldestAge(int today)No description in source.
weightedAgeFloorint weightedAgeFloor(int today)No description in source.
borrowAccruedint borrowAccrued(int today)Borrow cost accrued so far on the shares still short, not yet paid.
qtyOlderThanint qtyOlderThan(int today, int maxAge)Shares short for more than maxAge days.
isLongTermboolean isLongTerm(int i, int today, int threshold)A lot is long term when it is held for MORE than threshold days. Mirrors SLLongBook.isLongTerm exactly: added so a short position has the same term vocabulary as a long one, which it previously lacked.
qtyLongTermint qtyLongTerm(int today, int threshold)No description in source.
invariantsHoldboolean invariantsHold()---- Invariants ---- 1 every lot has positive quantity and price; 2 lot days never decrease and never pass the book day; 3 count is within the 16-lot capacity; 4 shares short = shares sold short - shares covered; 5 proceeds held = proceeds opened - proceeds covered.

SLShortMargin #sleela 3.0 (lib/advantage/trading-actions-on-verb/SLShortMargin.sleela)

SLShortMargin class

Illustrative margin arithmetic for a short position in exact integers: the ceiling requirement, equity and excess, the deposit needed to meet a call, the fewest shares to cover to restore margin (binary search), and the day a borrow cost first causes a call.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
maxValueint maxValue = 4000000000000000No description in source.
maxBpint maxBp = 15000No description in source.
maxSharesint maxShares = 100000000No description in source.
maxPriceint maxPrice = 10000000No description in source.
maxRateint maxRate = 1000No description in source.
maxDaysint maxDays = 10000000No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
shortValueint shortValue(int shares, int price)Short value in cents, or -1 when shares or price are outside their bounds.
requiredint required(int value, int bp)Required margin: ceiling of value * bp / 10000, or -1 for an input out of range. The ceiling never rounds in the holder favour.
equityint equity(int collateral, int shares, int price)Equity = collateral - short value. May be negative. An input out of range answers -2*maxValue, which no valid equity can reach.
inRangeboolean inRange(int collateral, int shares, int price, int bp)No description in source.
excessint excess(int collateral, int shares, int price, int bp)Excess = equity - required. Answers -2*maxValue when an input is out of range.
callDueboolean callDue(int collateral, int shares, int price, int bp)No description in source.
callAmountint callAmount(int collateral, int shares, int price, int bp)Deposit that restores excess to zero, or 0 when no call is due.
enoughAfterCoverboolean enoughAfterCover(int collateral, int shares, int price, int bp, int k)True when covering k shares leaves enough equity for the shares still short.
sharesToCoverint sharesToCover(int collateral, int shares, int price, int bp)Fewest shares to cover so the rest are adequately margined. Returns 0 when no cover is needed, -1 when no cover can help (equity is negative) or the input is out of range. Binary search. Invariant: the answer is in [lo, hi]. enoughAfterCover is monotone in k, because required falls as k grows while equity is fixed. hi - lo strictly shrinks, so the loop ends after about log2(shares) passes.
sharesToCoverScanint sharesToCoverScan(int collateral, int shares, int price, int bp)Reference: try k = 0, 1, 2, ... up to shares. Used to cross-check.
daysToCallint daysToCall(int collateral, int shares, int price, int bp, int rate)Borrow cost drains collateral by shares * rate each day at a fixed price. The first day d >= 0 on which the excess is negative: 0 when already due, floor(excess / burn) + 1 otherwise. Returns -2 when nothing drains (burn is 0), -3 when the day is beyond maxDays, and -1 for an input out of range.
daysToCallScanint daysToCallScan(int collateral, int shares, int price, int bp, int rate)Reference: step one day at a time until the excess is negative.

SLSophisticationCircuit #sleela 3.0 (lib/advantage/grading/SLSophisticationCircuit.sleela)

SLSophisticationCircuit class

The sophistication circuit grader -- registers modules, runs the grading circuit, and partitions them into winning/losing/grader/absolute sets with ratings.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
modulesSLModuleGrade[] modules---- Registered modules ----
countint countNo description in source.
capint capNo description in source.
winBarint winBar---- Circuit thresholds ----
loseBarint loseBarNo description in source.
absoluteBarint absoluteBarNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(int capacity, int win, int lose, int absolute)No description in source.
getWinBarint getWinBar()No description in source.
getLoseBarint getLoseBar()No description in source.
getAbsoluteBarint getAbsoluteBar()No description in source.
registervoid register(SLModuleGrade g)Register a pre-built module grade.
addSLModuleGrade add(String label, int score, int role)Convenience: build and register a module from name/score/role.
sizeint size()No description in source.
moduleAtSLModuleGrade moduleAt(int i)No description in source.
buildSetSLGradeSet buildSet(String name, int kind)---- Partition the field into a named set by the circuit rules ---- kind: 0 all, 1 winning, 2 losing, 3 grader, 4 absolute.
allModulesSLGradeSet allModules()No description in source.
winningModulesSLGradeSet winningModules()No description in source.
losingModulesSLGradeSet losingModules()No description in source.
graderModulesSLGradeSet graderModules()No description in source.
absoluteModulesSLGradeSet absoluteModules()No description in source.
championSLModuleGrade champion()The single best module in the field (highest score); null if empty.
describeString describe()No description in source.

SLSqlConnector #sleela 3.0 (lib/advantage/connect/SLSqlConnector.sleela)

SLSqlConnector class

The MySQL connector of the CONNECT medium. It holds connection coordinates and lifecycle state in the VM, validates every call, and maps to the native MySQL ABI (slsql_* -- mirrors lib/connector/mysql). Query and execute defer to a host adapter (STATUS_NATIVE_ADAPTER_REQUIRED) so no live database is dialed from inside the VM.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
vocabSLConnectStatus vocab---- Shared medium plumbing ----
faultSLConnectFault faultNo description in source.
hostString host = ""---- Connection coordinates + lifecycle ----
portint port = 3306No description in source.
userString user = ""No description in source.
hasSecretboolean hasSecret = falseNo description in source.
databaseString database = ""No description in source.
configuredboolean configured = falseNo description in source.
openboolean open = falseNo description in source.
execCountint execCount = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
initvoid init()No description in source.
configureint configure(String h, int p, String u, boolean secretPresent, String db)Set the coordinates. secretPresent is a flag, never the secret itself; the real secret is pinned in the keystore and read by the native adapter.
openLinkint openLink()Open the link (native: slsql_open). In the VM this validates state and marks the link open; a real connection is a host-adapter responsibility.
pingint ping()Liveness check (native: slsql_ping).
executeint execute(String sql)Execute a non-query statement (native: slsql_execute). Needs a host adapter.
queryint query(String sql)Run a row-returning query (native: slsql_query). Needs a host adapter.
closeLinkint closeLink()Close the link (native: slsql_close). Idempotent.
activeboolean active()No description in source.
isNativeReadyboolean isNativeReady()No description in source.
executeCountint executeCount()No description in source.
lastFaultSLConnectFault lastFault()No description in source.
coordinateString coordinate()A redacted, log-safe coordinate string -- never the user or secret.
describeString describe()No description in source.

SLTallScience #sleela 3.0 (lib/advantage/modules/moral/SLTallScience.sleela)

SLTallScience class

Tall Science: the United States held as a cataloged Item.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
itemNameString itemName = "the United States"Tall Science: the United States held as an ITEM in a catalog, with the lists it carries: subject nouns, names, scientific individuals, moral individuals, and its boundary. This is a reference record for judging a trade. Nothing is bought or sold, and no person is profiled: individuals are listed as roles or public-record names supplied by the caller. The nouns and names lists are read respectively: entry i of one pairs with entry i of the other, so they must have the same length.
hasItemboolean hasItem = falseNo description in source.
inBoundaryboolean inBoundary = falseNo description in source.
respectedboolean respected = falseNo description in source.
nounsString[] nounsNo description in source.
namesString[] namesNo description in source.
sciString[] sciNo description in source.
morString[] morNo description in source.
nNounsint nNouns = 0No description in source.
nNamesint nNames = 0No description in source.
nSciint nSci = 0No description in source.
nMorint nMor = 0No description in source.
builtboolean built = falseNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
buildvoid build()No description in source.
setItemNamevoid setItemName(String n)No description in source.
setBoundaryvoid setBoundary(boolean b)No description in source.
setRespectedvoid setRespected(boolean b)No description in source.
declareItemvoid declareItem()No description in source.
countNounsint countNouns()No description in source.
countNamesint countNames()No description in source.
countScientificint countScientific()No description in source.
countMoralint countMoral()No description in source.
canonicalboolean canonical()No description in source.
pairedboolean paired()No description in source.
registerboolean register(int list, String text)No description in source.
seedvoid seed()No description in source.

SLTechInstallerII #sleela 3.0 (lib/advantage/connect/SLTechInstallerII.sleela)

SLTechInstallerII class

Tech Installer II -- a credentialed installer authority that applies the actual Use of the Advantage(TM) System onto an Install Set or a Setting, under ceteris-paribus semantics (hold all else equal: change only what the install declares, leave every unrelated setting untouched). The authority is held by Max Rupplin of MEARVK LLC, North Carolina, 2026 and forward. Installs run through the connect medium and report via status codes and a fault record, never by throwing.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
holderString holder = "Max Rupplin"No description in source.
corporationString corporation = "MEARVK LLC"No description in source.
jurisdictionString jurisdiction = "North Carolina, United States"No description in source.
tierString tier = "Tech Installer II"No description in source.
licenceFromYearint licenceFromYear = 2026No description in source.
licenceToYearint licenceToYear = 00 means open-ended (2026 and forward)
vocabSLConnectStatus vocab---- Shared medium plumbing + install tally ----
faultSLConnectFault faultNo description in source.
authorizedboolean authorized = falseNo description in source.
installSetCountint installSetCount = 0No description in source.
settingCountint settingCount = 0No description in source.
noopCountint noopCount = 0No description in source.
lastTargetKindString lastTargetKind = "none"No description in source.
lastTargetNameString lastTargetName = "none"No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
initvoid init()No description in source.
licenceCoversYearboolean licenceCoversYear(int year)The licence covers a given calendar year (2026+, open-ended).
authorizeint authorize(String who, String corp, int year)No description in source.
installSetint installSet(String setName, boolean alreadyPresent)No description in source.
applySettingint applySetting(String settingName, boolean alreadyEqual)No description in source.
appliedCountint appliedCount()Total distinct installs actually applied (sets + settings, excluding no-ops).
isAuthorizedboolean isAuthorized()No description in source.
getHolderString getHolder()No description in source.
getCorporation2String getCorporation2()No description in source.
getJurisdictionString getJurisdiction()No description in source.
getTierString getTier()No description in source.
getInstallSetCountint getInstallSetCount()No description in source.
getSettingCountint getSettingCount()No description in source.
getNoopCountint getNoopCount()No description in source.
lastFaultSLConnectFault lastFault()No description in source.
credentialString credential()A log-safe credential card.
describeString describe()No description in source.

SLTermPotency #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-term-potencies/SLTermPotency.sleela)

SLTermPotency class

Defines 'potency' precisely as two exact ratios over a book's existing age data, overloaded for both SLLongBook and SLShortBook: term potency (the basis-point share of held/short units that have crossed the long-term threshold) and age potency (how close the weighted-average age is to the oldest lot's age), both in basis points so no cent of precision is rounded away.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
termPotencyBpint termPotencyBp(SLLongBook book, int today, int threshold)Term potency in basis points: long-term units / held units, or -1 when today is invalid for the book (see SLLongBook.validToday) or -2 when the book holds nothing (there is no share of nothing to report).
agePotencyBpint agePotencyBp(SLLongBook book, int today)Age potency in basis points: weightedAgeFloor / oldestAge. Returns -1 for BOTH a flat book and an invalid today, because SLLongBook.oldestAge itself returns -1 for both of those cases and does not distinguish them (see its own comment); this method does not invent a finer distinction than the book it reads from already makes. 10000 exactly when every held unit shares the oldest lot's day (oldestAge is then 0, a zero/zero case read as full potency: there is only one age present, so the weighted average IS that age).
atLeastHalfLongTermboolean atLeastHalfLongTerm(SLLongBook book, int today, int threshold)Convenience: true when term potency is at or above halfBp (so a caller can ask "is at least half the book long term" without re-deriving the threshold on 5000). Returns false on any invalid/empty input, never a crash or a guess.
termPotencyBpint termPotencyBp(SLShortBook book, int today, int threshold)No description in source.
agePotencyBpint agePotencyBp(SLShortBook book, int today)No description in source.
atLeastHalfLongTermboolean atLeastHalfLongTerm(SLShortBook book, int today, int threshold)No description in source.

SLTradeMath #sleela 3.0 (lib/advantage/math/SLTradeMath.sleela)

SLTradeMath class

Shared real-valued math helpers for the advantage trade subject -- exponential, natural log, and general power.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
intToDdouble intToD(int n)int -> double coercion that works regardless of implicit promotion.
expDdouble expD(double x)Natural exponential via a truncated Taylor series with range reduction by halving: e^x = (e^(x/2^k))^(2^k).
lnDdouble lnD(double y)Natural logarithm via atanh series: ln(y) = 2*atanh((y-1)/(y+1)), with range reduction pulling y into (0.5, 2) by factoring out e.
powABdouble powAB(double a, double b)General power a^b for a > 0 via exp(b * ln a). a <= 0 returns 0.
sqrtDdouble sqrtD(double a)Convenience square root (powAB with exponent 0.5).
absDdouble absD(double a)Absolute value for doubles.

SLTradingAggregation #sleela 3.0 (lib/advantage/trading/SLTradingAggregation.sleela)

SLTradingAggregation class

Fragmented supply aggregation: collect many small items into a cohesive set and sell the set at a premium, pricing the chance it never completes.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
evaluateSLTradingResult evaluate(double setValue, double piecemealValuePerItem,No description in source.

SLTradingApproach #sleela 3.0 (lib/advantage/trading/SLTradingApproach.sleela)

SLTradingApproach class

One trading approach as a source of leverage: recorded evidence, assumptions held or doubted, and the honest score (mean x confidence x trust).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
idString id = ""No description in source.
nameString name = ""No description in source.
rewardsdouble[] rewardsNo description in source.
baselinesdouble[] baselinesNo description in source.
countint count = 0No description in source.
capacityint capacity = 0No description in source.
assumptionsHeldint assumptionsHeld = 0No description in source.
assumptionsTotalint assumptionsTotal = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureboolean configure(String approachId, String approachName, int held, int total)The held count must be between 0 and the total. Returns false otherwise.
getIdString getId()No description in source.
getNameString getName()No description in source.
getCountint getCount()No description in source.
getAssumptionsHeldint getAssumptionsHeld()No description in source.
getAssumptionsTotalint getAssumptionsTotal()No description in source.
finiteNumberboolean finiteNumber(double v)No description in source.
addObservationboolean addObservation(double reward, double baseline)Record one observation. Rejects non-finite values and a full ledger.
addTradeboolean addTrade(SLTradingResult r, double costOfCapital, boolean perUnitCost)No description in source.
meandouble mean()Mean advantage over the evidence; 0.0 when there is none (unknown).
sqrtDdouble sqrtD(double x)Square root by Newton iteration, so no external math library is needed.
spreaddouble spread()Sample standard deviation of the per-observation advantage; 0.0 below 2.
confidencedouble confidence(double prior)No description in source.
trustdouble trust()Share of the assumptions still held; 1.0 when none are recorded.
scoredouble score(double prior)score = mean advantage x confidence x trust
cautionsString cautions(double prior, int minEvidence)Plain-language reasons the score should be taken with care.
describeString describe(double prior)No description in source.

SLTradingArbitrage #sleela 3.0 (lib/advantage/trading/SLTradingArbitrage.sleela)

SLTradingArbitrage class

Arbitrage: the same asset at two prices on two venues, net of both-leg fees, slippage, fixed and holding costs, with a break-even sell price.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
inputsOkboolean inputsOk(double buyPrice, double sellPrice, double quantity,No description in source.
totalCostdouble totalCost(double buyPrice, double quantity, double buyFeeRate,No description in source.
evaluateSLTradingResult evaluate(double buyPrice, double sellPrice, double quantity,No description in source.
breakevendouble breakeven(double buyPrice, double sellPrice, double quantity,Lowest sell price per unit at which the arbitrage breaks even. Returns -1.0 when the inputs are invalid.

SLTradingAsymmetry #sleela 3.0 (lib/advantage/trading/SLTradingAsymmetry.sleela)

SLTradingAsymmetry class

Informational asymmetry: a listing is mislabeled or misunderstood; one evaluation is one candidate, pricing the race and the read.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
pricesOkboolean pricesOk(double listedPrice, double estimatedValue)Apparent discount = 1 - listed / estimated (0.6 means listed 60 percent below the estimate). Check pricesOk first; discount returns -1000000.0 for invalid prices.
discountdouble discount(double listedPrice, double estimatedValue)No description in source.
evaluateSLTradingResult evaluate(double listedPrice, double genuineValue,No description in source.

SLTradingCheck #sleela 3.0 (lib/advantage/trading/SLTradingCheck.sleela)

SLTradingCheck class

Shared fail-closed validation helpers and finite bounds for the trading models (amount, positive, rate, probability, days, distribution).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
maxAmountdouble maxAmount()---- finite bounds (same limits as the C core) ----
maxHoldDaysdouble maxHoldDays()No description in source.
probTolerancedouble probTolerance()No description in source.
maxOutcomesint maxOutcomes()No description in source.
maxLotsint maxLots()No description in source.
maxComponentsint maxComponents()No description in source.
isFiniteboolean isFinite(double v)No description in source.
isAmountboolean isAmount(double v)finite and 0 up to the amount cap
isPositiveboolean isPositive(double v)finite and strictly above 0, up to the amount cap
isRateboolean isRate(double v)finite, 0 up to but not including 1
isProbboolean isProb(double v)finite, 0 up to and including 1
isDaysboolean isDays(double v)finite, 0 up to the maximum holding time
isDistributionboolean isDistribution(double[] p, int n)No description in source.
failSLTradingResult fail(String why)No description in source.
rangeMessageString rangeMessage()Standard messages, shared so every model words its rejections the same.
distributionMessageString distributionMessage()No description in source.
countMessageString countMessage()No description in source.
finishSLTradingResult finish(double totalCost, double proceeds, double holdDays)No description in source.

SLTradingConsignment #sleela 3.0 (lib/advantage/trading/SLTradingConsignment.sleela)

SLTradingConsignment class

Consignment and zero inventory: earn a commission without owning anything, pricing labor and counterparty risk.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
evaluateSLTradingResult evaluate(double salePrice, double commissionRate,No description in source.

SLTradingCounsel #sleela 3.0 (lib/advantage/trading/SLTradingCounsel.sleela)

SLTradingCounsel class

Counsel over trading approaches: ranks approaches best-first by their honest score and reports the cautions that go with each.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
itemsSLTradingApproach[] itemsNo description in source.
countint count = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
initvoid init()No description in source.
sizeint size()No description in source.
addboolean add(SLTradingApproach a)No description in source.
atSLTradingApproach at(int i)No description in source.
rankint[] rank(double prior)No description in source.
lineString line(int position, int[] order, double prior)One ranked line for a position in the order returned by rank().
cautionsForString cautionsFor(int position, int[] order, double prior, int minEvidence)No description in source.

SLTradingDistressed #sleela 3.0 (lib/advantage/trading/SLTradingDistressed.sleela)

SLTradingDistressed class

Distressed inventory and liquidation: buy from a seller who wants speed, pricing the race against institutional liquidators and the unsold remainder.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
evaluateSLTradingResult evaluate(double lotPrice, double units,No description in source.

SLTradingMarketMaking #sleela 3.0 (lib/advantage/trading/SLTradingMarketMaking.sleela)

SLTradingMarketMaking class

Market making: quote both sides and earn the spread, pricing the case where inventory does not turn over.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
quoteOkboolean quoteOk(double fairValue, double halfSpreadRate)Symmetric quote around a fair value: bid = fair*(1-h), ask = fair*(1+h).
biddouble bid(double fairValue, double halfSpreadRate)No description in source.
askdouble ask(double fairValue, double halfSpreadRate)No description in source.
evaluateSLTradingResult evaluate(double bid, double ask, double quantity,No description in source.

SLTradingMomentum #sleela 3.0 (lib/advantage/trading/SLTradingMomentum.sleela)

SLTradingMomentum class

Event-driven momentum: enter on a news or trend shock and exit while demand is elevated, with exit failure as a first-class outcome and hype decay.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
pow2negdouble pow2neg(double x)---- hype decay: remaining = initial * 0.5 ^ (days / halfLife) ---- 2 ^ -x is built from whole halvings plus a short Taylor series for the fractional part, so no external math library is needed.
hypeDecaydouble hypeDecay(double initialExcess, double halfLifeDays, double days)Excess price above baseline left after the given days. Returns -1.0 for invalid input; a real remainder is never negative.
evaluateSLTradingResult evaluate(double entryPrice, double quantity,No description in source.

SLTradingRateBudget #sleela 3.0 (lib/advantage/trading/SLTradingRateBudget.sleela)

SLTradingRateBudget class

Rate budget: stay inside the rate limit a server publishes by turning the X-RateLimit and Retry-After values into a wait before the next request.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
limitdouble limit = -1.0No description in source.
remainingdouble remaining = -1.0No description in source.
resetSecondsdouble resetSeconds = -1.0No description in source.
retryAfterSecondsdouble retryAfterSeconds = -1.0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
initvoid init()No description in source.
getLimitdouble getLimit()No description in source.
getRemainingdouble getRemaining()No description in source.
getResetSecondsdouble getResetSeconds()No description in source.
getRetryAfterSecondsdouble getRetryAfterSeconds()No description in source.
valueOkboolean valueOk(double v)A header value is acceptable when absent (-1.0) or a finite number from 0 up to 1e12. NaN fails every ordered comparison, so it is rejected.
observeboolean observe(double limitValue, double remainingValue,No description in source.
secondsUntilResetdouble secondsUntilReset(double resetValue, double nowEpochSeconds)No description in source.
nextDelayMsdouble nextDelayMs(double reserve, double minIntervalMs, double maxWaitMs)No description in source.
mustStopboolean mustStop(double reserve, double minIntervalMs, double maxWaitMs)True when the required wait is longer than the caller allows: the caller should stop instead of sleeping. Also true when the options are invalid.

SLTradingRefurbishment #sleela 3.0 (lib/advantage/trading/SLTradingRefurbishment.sleela)

SLTradingRefurbishment class

Value-add refurbishment: buy raw or distressed, improve, sell into a higher tier, with the result expressed as a distribution of outcomes.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
evaluateSLTradingResult evaluate(double acquirePrice, double quantity,No description in source.

SLTradingRegional #sleela 3.0 (lib/advantage/trading/SLTradingRegional.sleela)

SLTradingRegional class

Regional and geofenced arbitrage: buy in one place, move it, sell in another, pricing the chance the move fails or damages the goods.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
pricesOkboolean pricesOk(double buyPrice, double sellPrice)Regional premium = sell / buy - 1 (0.05 means a 5 percent premium). Check pricesOk first: premium returns -2.0 for invalid prices, and a real premium can never be below -1.
premiumdouble premium(double buyPrice, double sellPrice)No description in source.
evaluateSLTradingResult evaluate(double buyPrice, double sellPrice, double quantity,No description in source.

SLTradingResult #sleela 3.0 (lib/advantage/trading/SLTradingResult.sleela)

SLTradingResult class

The common evaluation result of every trading model: total cost, expected proceeds, expected profit, return on cost, holding time, plus the advantage bridge (baseline and advantage net of the opportunity cost of capital).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
okboolean ok = false---- result state ----
errorString error = "not evaluated"No description in source.
totalCostdouble totalCost = 0.0No description in source.
expectedProceedsdouble expectedProceeds = 0.0No description in source.
expectedProfitdouble expectedProfit = 0.0No description in source.
returnOnCostdouble returnOnCost = 0.0No description in source.
holdDaysdouble holdDays = 0.0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(double cost, double proceeds, double days)Record a successful evaluation. Profit and return on cost are derived.
failWithvoid failWith(String why)Record a rejected evaluation. All numeric fields are reset to zero so a rejected result can never be mistaken for a real one.
isOkboolean isOk()No description in source.
getErrorString getError()No description in source.
getTotalCostdouble getTotalCost()No description in source.
getExpectedProceedsdouble getExpectedProceeds()No description in source.
getExpectedProfitdouble getExpectedProfit()No description in source.
getReturnOnCostdouble getReturnOnCost()No description in source.
getHoldDaysdouble getHoldDays()No description in source.
rateOkboolean rateOk(double costOfCapital)A cost of capital is a yearly fraction between 0 and 10. NaN fails both comparisons, so it is rejected too.
baselinedouble baseline(double costOfCapital)No description in source.
advantagedouble advantage(double costOfCapital)No description in source.
describeString describe()No description in source.

SLTradingSynthetic #sleela 3.0 (lib/advantage/trading/SLTradingSynthetic.sleela)

SLTradingSynthetic class

Synthetic bundling: turn one thing into many or many into one, with waste and fallback values for what does not sell.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
evaluateSLTradingResult evaluate(double inputCost, double fixedCosts,No description in source.

SLTradingVirtual #sleela 3.0 (lib/advantage/trading/SLTradingVirtual.sleela)

SLTradingVirtual class

Virtual inventory: take payment first and source the item after, pricing fulfilment failure and source price drift.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
chkSLTradingCheck chk---- shared validation, created on first use ----

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkSLTradingCheck check()No description in source.
evaluateSLTradingResult evaluate(double salePrice, double sourcePrice,No description in source.

SLTransactionalGeodesic #sleela 3.0 (lib/advantage/physics/SLTransactionalGeodesic.sleela)

SLTransactionalGeodesic class

The transactional geodesic -- the shortest transaction path through a trust-warped manifold, via the geodesic equation.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
tau0double tau0---- Trust field tau(x,y) = tau0 + gx*x + gy*y (clamped) ----
gxdouble gxNo description in source.
gydouble gyNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureFieldvoid configureField(double tau0v, double gxv, double gyv)No description in source.
tauAtdouble tauAt(double x, double y)No description in source.
phiXdouble phiX(double x, double y)phi gradients: phi_x = -0.5 * gx / tau, phi_y = -0.5 * gy / tau.
phiYdouble phiY(double x, double y)No description in source.
accelerationdouble[] acceleration(double x, double y, double vx, double vy)Acceleration from the geodesic equation, d2x/dl2 = -Gamma(v,v), returned as a flat double[2] = (ax, ay) given position (x,y) and velocity (vx,vy).
geodesicLengthdouble geodesicLength(double x0, double y0, double x1, double y1,No description in source.
euclideandouble euclidean(double x0, double y0, double x1, double y1, SLPhysicsMath m)Convenience: the straight-line Euclidean distance (flat-field reference).
isStraightLineboolean isStraightLine(double tol)Are Christoffel symbols effectively zero here (uniform trust => flat)?

SLTrialCompartment #sleela 3.0 (lib/advantage/integration/SLTrialCompartment.sleela)

SLTrialCompartment class

Trial compartment -- a study/experiment compartment for the vertical-integration subject.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
spaceSLCompartment spaceNo description in source.
outcomesint[] outcomesNo description in source.
countint countNo description in source.
capint capNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String lbl, SLIntegrationKind cat, int maxTrials)No description in source.
getSpaceSLCompartment getSpace()No description in source.
getCountint getCount()No description in source.
logTrialboolean logTrial(int score)Record a trial outcome score. Returns true if recorded (space remained). (Named logTrial, not record: `record` is a reserved SLeeLa keyword.)
passingint passing(int threshold)How many recorded trials met or exceeded a pass threshold.
successRateint successRate(int threshold)Success rate as a percentage 0..100 at a threshold (0 if no trials).
meanScoreint meanScore()Mean outcome score (integer division; 0 if no trials).
describeString describe()No description in source.

SLTrustDecaySDE #sleela 3.0 (lib/advantage/physics/SLTrustDecaySDE.sleela)

SLTrustDecaySDE class

Stochastic trust decay -- a CIR mean-reverting diffusion with a Poisson jump for announcement breaches.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
kappadouble kappa---- Parameters ---- mean-reversion speed
tauBardouble tauBarlong-run baseline trust
sigmadouble sigmadiffusion (noise) scale
deltadouble deltajump size of a breach (trust lost per jump)

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(double k, double tb, double s, double d)No description in source.
clampdouble clamp(double t)Keep trust in [0,1] (a trust probability/parameter).
stepdouble step(double tau, double dt, double dW, double dJ, SLPhysicsMath m)No description in source.
expectedStepdouble expectedStep(double tau, double dt)The deterministic (expected) step: dW=0, no jump. tau_{t+dt} = tau + kappa(tauBar - tau) dt.
expectedPathdouble expectedPath(double tau0, double dt, int n)No description in source.
breachdouble breach(double tau)No description in source.
describeString describe()No description in source.

SLTrustMetric #sleela 3.0 (lib/advantage/physics/SLTrustMetric.sleela)

SLTrustMetric class

The trust field as a metric tensor g_mu_nu over a 2D economic manifold (operational distance x volume).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
conformalFactordouble conformalFactor(double tau)Conformal factor f(tau) = 1/tau. Clamps tiny tau to avoid overflow.
metricAtdouble[] metricAt(double tau)Build the 2x2 metric at a given trust level into a flat double[4].
lineElementSqdouble lineElementSq(double tau, double dx, double dy)Squared line element of displacement (dx,dy) under trust tau: ds^2 = g_xx dx^2 + 2 g_xy dx dy + g_yy dy^2.
effectiveDistancedouble effectiveDistance(double tau, double dx, double dy, SLPhysicsMath m)Effective operational distance (cost to cross) for a straight displacement (dx,dy) under trust tau: sqrt(ds^2) = sqrt(f) * sqrt(dx^2+dy^2). As tau->0 this inflates without bound; as tau->1 it approaches the Euclidean length.
warpingdouble warping(double tau)Scalar curvature proxy for this conformal family in 2D: with g = e^{2 phi} I and phi = -0.5 ln(tau), the Gaussian curvature is K = -e^{-2 phi} lap(phi). Here phi depends only on the (constant-in-space) tau, so spatial curvature is 0 for a uniform field; the ECONOMIC curvature we report is the field's departure from flatness, f(tau) - 1 >= 0 (0 at full trust, growing as trust falls). This is the "warping" the analogy cares about.
isFlatboolean isFlat(double tau, double tol)Is the field effectively flat (Euclidean) at this trust level?
describeString describe(double tau)No description in source.

SLVerticalIntegration #sleela 3.0 (lib/advantage/integration/SLVerticalIntegration.sleela)

SLVerticalIntegration class

Vertical integration through capitalism/retail -- an ordered vertical stack of compartment tiers, recursively composable.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
nameString nameNo description in source.
catSLIntegrationKind catNo description in source.
tiersSLCompartment[] tiersthe vertical stack, index 0 = most upstream
tierCountint tierCountNo description in source.
tierCapint tierCapNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String nm)No description in source.
getNameString getName()No description in source.
catalogSLIntegrationKind catalog()No description in source.
getTierCountint getTierCount()No description in source.
addTierint addTier(SLCompartment tier)Append a tier downstream. Returns its tier index (0 = most upstream).
addKindSLCompartment addKind(String label, int kind)Build and append a tier of a given kind in one call; returns the tier.
tierAtSLCompartment tierAt(int i)No description in source.
flowDownstreamint flowDownstream(int i, int amount)---- Vertical flow: push units from upstream tier i to downstream i+1 ---- Moves up to `amount` used units out of tier i and stores them in tier i+1, limited by what tier i holds and what tier i+1 can accept. Returns moved.
runChainint runChain(int amount)Run one full upstream->downstream sweep moving `amount` per hop. Returns the units delivered into the most downstream (retail) tier.
totalCompartmentsint totalCompartments()---- Aggregates over the whole recursive tree ----
totalCapacityint totalCapacity()No description in source.
totalUsedint totalUsed()No description in source.
totalRelevanceint totalRelevance()No description in source.
maxDepthint maxDepth()Maximum recursion depth across all tiers (how deep the nesting goes).
sophisticationint sophistication()No description in source.
utilizationint utilization()Utilization percentage of the whole tree (0 if no capacity).
describeString describe()No description in source.
emitThroughvoid emitThrough(SLAdvantageEmitter em)Report this model through an output emitter (terminal / commonrails / socket / silent); the emitter and its sink decide the destination.

smartphone-trade #sleela 3.0 (lib/advantage/examples/professional/network-trades/smartphone-trade.sleela)

SmartphoneTrade class

NETWORK-TRADE 11 of 12 -- SMARTPHONE. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: a finished consumer device; distribution-scale volume.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

solar-panel-trade #sleela 3.0 (lib/advantage/examples/advanced/network-trades/solar-panel-trade.sleela)

SolarPanelTrade class

NETWORK-TRADE 07 of 12 -- SOLAR-PANEL. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: a manufactured good; seller-leaning power (alpha=0.6).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

steel-coil-trade #sleela 3.0 (lib/advantage/examples/medium/network-trades/steel-coil-trade.sleela)

SteelCoilTrade class

NETWORK-TRADE 04 of 12 -- STEEL-COIL. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: heavy stock where TIME costs real carry per unit per day.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

TaMed01Coppercoins #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/01-copper-coins/TaMed01Coppercoins.sleela)

TaMed01Coppercoins class

Medium-term entry 1: copper coins, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed02Silvertradingtokens #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/02-silver-tokens/TaMed02Silvertradingtokens.sleela)

TaMed02Silvertradingtokens class

Medium-term entry 2: silver trading tokens, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed03Goldgamechips #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/03-gold-chips/TaMed03Goldgamechips.sleela)

TaMed03Goldgamechips class

Medium-term entry 3: gold game chips, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed04Brassrounds #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/04-brass-rounds/TaMed04Brassrounds.sleela)

TaMed04Brassrounds class

Medium-term entry 4: brass rounds, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed05Bronzetradingmedals #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/05-bronze-medals/TaMed05Bronzetradingmedals.sleela)

TaMed05Bronzetradingmedals class

Medium-term entry 5: bronze trading medals, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed06Nickelblanks #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/06-nickel-blanks/TaMed06Nickelblanks.sleela)

TaMed06Nickelblanks class

Medium-term entry 6: nickel blanks, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed07Tinpucks #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/07-tin-pucks/TaMed07Tinpucks.sleela)

TaMed07Tinpucks class

Medium-term entry 7: tin pucks, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed08Zincslugs #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/08-zinc-slugs/TaMed08Zincslugs.sleela)

TaMed08Zincslugs class

Medium-term entry 8: zinc slugs, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed09Steelwashers #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/09-steel-washers/TaMed09Steelwashers.sleela)

TaMed09Steelwashers class

Medium-term entry 9: steel washers, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed10Platinumfoils #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/10-platinum-foils/TaMed10Platinumfoils.sleela)

TaMed10Platinumfoils class

Medium-term entry 10: platinum foils, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed11Titaniumtabs #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/11-titanium-tabs/TaMed11Titaniumtabs.sleela)

TaMed11Titaniumtabs class

Medium-term entry 11: titanium tabs, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed12Irontags #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/12-iron-tags/TaMed12Irontags.sleela)

TaMed12Irontags class

Medium-term entry 12: iron tags, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed13Quartzcountingchips #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/13-quartz-chips/TaMed13Quartzcountingchips.sleela)

TaMed13Quartzcountingchips class

Medium-term entry 13: quartz counting chips, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed14Obsidiantradingflakes #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/14-obsidian-flakes/TaMed14Obsidiantradingflakes.sleela)

TaMed14Obsidiantradingflakes class

Medium-term entry 14: obsidian trading flakes, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed15Granitecounters #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/15-granite-counters/TaMed15Granitecounters.sleela)

TaMed15Granitecounters class

Medium-term entry 15: granite counters, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed16Slatemarkers #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/16-slate-markers/TaMed16Slatemarkers.sleela)

TaMed16Slatemarkers class

Medium-term entry 16: slate markers, a short-horizon active trade (two buys, one sell), checked against the daily action cap of 2000.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed17DailyCapBoundary #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/17-daily-cap-boundary/TaMed17DailyCapBoundary.sleela)

TaMed17DailyCapBoundary class

The 2,000-actions-per-day rule proved at its boundary: the 2000th action on a day succeeds, the 2001st is refused unchanged, and a new day resets the count.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
mainvoid main()No description in source.

TaMed18ShortCoins #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/18-short-coins/TaMed18ShortCoins.sleela)

TaMed18ShortCoins class

Medium-term entry 18: short-sold trading coins, a short-horizon active SHORT trade (two short-sells, one cover), checked against the daily action cap of 2000 and borrow cost.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed19ShortTokens #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/19-short-tokens/TaMed19ShortTokens.sleela)

TaMed19ShortTokens class

Medium-term entry 19: short-sold game tokens, a short-horizon active SHORT trade (two short-sells, one cover), checked against the daily action cap of 2000 and borrow cost.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaMed20ShortChips #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-medium-averages/20-short-chips/TaMed20ShortChips.sleela)

TaMed20ShortChips class

Medium-term entry 20: short-sold collector chips, a short-horizon active SHORT trade (two short-sells, one cover), checked against the daily action cap of 2000 and borrow cost.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLDailyCapShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaPotency01AgesAsTheBookAges #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-term-potencies/01-ages-as-the-book-ages/TaPotency01AgesAsTheBookAges.sleela)

TaPotency01AgesAsTheBookAges class

Entry 1: term potency and age potency measured at three checkpoints as a two-lot portfolio crosses the long-term threshold.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaPotency02FifoSellAndPotency #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-term-potencies/02-fifo-sell-and-potency/TaPotency02FifoSellAndPotency.sleela)

TaPotency02FifoSellAndPotency class

Entry 2: a FIFO sell of an entire lot removes that lot's contribution to both term potency and age potency, shown as an exact before/after comparison.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaPotency03HonestEmptyAndInvalid #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-term-potencies/03-honest-empty-and-invalid/TaPotency03HonestEmptyAndInvalid.sleela)

TaPotency03HonestEmptyAndInvalid class

Entry 3: term potency and age potency on an empty book and on an invalid ('before the book day') today, each answered honestly rather than guessed.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaPotency04CrossCheckedPortfolios #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-term-potencies/04-cross-checked-portfolios/TaPotency04CrossCheckedPortfolios.sleela)

TaPotency04CrossCheckedPortfolios class

Entry 4: ten randomly generated portfolios, each checked against an independent Python model of the same term-potency and age-potency formulas.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaPotency05ShortSideMirror #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-term-potencies/05-short-side-mirror/TaPotency05ShortSideMirror.sleela)

TaPotency05ShortSideMirror class

Entry 5: the short-side overloads of term potency and age potency, mirroring entry 1's exact lot structure and ages, confirming the formulas give identical readings on either book shape.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaPotency06ShortSideHonestyAndCover #sleela 3.0 (lib/advantage/learner-vs-professional/courseware/long-term-potencies/06-short-side-honesty-and-cover/TaPotency06ShortSideHonestyAndCover.sleela)

TaPotency06ShortSideHonestyAndCover class

Entry 6: honest -1/-2 answers for an empty short book and an invalid day, then a FIFO cover removing the oldest short's whole contribution to both potencies, mirroring entries 2 and 3 on the short side.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse01OpenAndAdd #sleela 3.0 (lib/advantage/trading-actions-on-verb/01-open-and-add/TaUse01OpenAndAdd.sleela)

TaUse01OpenAndAdd class

Trading long, open then add: buy verbs build FIFO lots and an average cost with an exact remainder.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse02TrimRealizedPnl #sleela 3.0 (lib/advantage/trading-actions-on-verb/02-trim-realized-pnl/TaUse02TrimRealizedPnl.sleela)

TaUse02TrimRealizedPnl class

Trading long, trim: a partial sell consumes the oldest lot first and realizes profit on exactly that cost.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse03FlattenAndReconcile #sleela 3.0 (lib/advantage/trading-actions-on-verb/03-flatten-and-reconcile/TaUse03FlattenAndReconcile.sleela)

TaUse03FlattenAndReconcile class

Trading long, flatten: the last sell empties the book and total profit reconciles to proceeds minus cost minus fees.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse04RefuseShortAndBadInput #sleela 3.0 (lib/advantage/trading-actions-on-verb/04-refuse-short-and-bad-input/TaUse04RefuseShortAndBadInput.sleela)

TaUse04RefuseShortAndBadInput class

Trading long, refusals: a sell above the holding, bad quantity, bad price, backwards day and flat sells are refused and the book never changes.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.
sQtyint sQty = 0No description in source.
sCostint sCost = 0No description in source.
sFeesint sFees = 0No description in source.
sDayint sDay = 0No description in source.
sLotsint sLots = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
takevoid take(SLLongBook b)No description in source.
sameboolean same(SLLongBook b)No description in source.
mainvoid main()No description in source.

TaUse05LotRatioByEuclid #sleela 3.0 (lib/advantage/trading-actions-on-verb/05-lot-ratio-by-euclid/TaUse05LotRatioByEuclid.sleela)

TaUse05LotRatioByEuclid class

Trading long, order ratios: Euclid loop reduces a basket of order sizes to the smallest whole-number ratio, showing every remainder step.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse06RoundLotFillAndBezout #sleela 3.0 (lib/advantage/trading-actions-on-verb/06-round-lot-fill-and-bezout/TaUse06RoundLotFillAndBezout.sleela)

TaUse06RoundLotFillAndBezout class

Trading long, exact fills: the gcd test is necessary but not sufficient for filling an order with two round-lot sizes; Bezout coefficients prove the gcd.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse07RebalanceDistance #sleela 3.0 (lib/advantage/trading-actions-on-verb/07-rebalance-distance/TaUse07RebalanceDistance.sleela)

TaUse07RebalanceDistance class

Trading long, rebalancing: squared Euclidean distance and an integer square root pick the nearest of several target portfolios, with ties to the first.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse08HoldingDays #sleela 3.0 (lib/advantage/trading-actions-on-verb/08-holding-days/TaUse08HoldingDays.sleela)

TaUse08HoldingDays class

Time on long, age: a lot's age is today minus its buy day; time may pass with hold but never run backwards.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse09FifoAging #sleela 3.0 (lib/advantage/trading-actions-on-verb/09-fifo-aging/TaUse09FifoAging.sleela)

TaUse09FifoAging class

Time on long, FIFO: a sell consumes the oldest lots first, so what remains is younger and the ages are exact.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse10WeightedAverageAge #sleela 3.0 (lib/advantage/trading-actions-on-verb/10-weighted-average-age/TaUse10WeightedAverageAge.sleela)

TaUse10WeightedAverageAge class

Time on long, weighted age: the quantity-weighted average holding period is exact when divisible and a floor otherwise.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse11TermBoundary #sleela 3.0 (lib/advantage/trading-actions-on-verb/11-term-boundary/TaUse11TermBoundary.sleela)

TaUse11TermBoundary class

Time on long, short term versus long term: a lot is long term only when held MORE than the threshold, so day 365 is still short.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse12TimeStop #sleela 3.0 (lib/advantage/trading-actions-on-verb/12-time-stop/TaUse12TimeStop.sleela)

TaUse12TimeStop class

Time on long, time stop: a loop sells every share held longer than a limit; it must end because the old quantity strictly falls.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse13FullLifecycle #sleela 3.0 (lib/advantage/trading-actions-on-verb/13-full-lifecycle/TaUse13FullLifecycle.sleela)

TaUse13FullLifecycle class

Trading long over time: buys, a hold, a trim, a long-term sale and a flatten, with invariants after every action and an independent reconciliation.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse14DifferentialStress #sleela 3.0 (lib/advantage/trading-actions-on-verb/14-differential-stress/TaUse14DifferentialStress.sleela)

TaUse14DifferentialStress class

Trading long, differential stress: 1200 random verbs are run against SLLongBook and against an independent per-share shadow model, and every observable must agree after every step.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.
stateint state = 1No description in source.
spint[] sp = new int[6000]No description in source.
sdint[] sd = new int[6000]No description in source.
slint[] sl = new int[6000]No description in source.
mint m = 0No description in source.
shLastint shLast = 0No description in source.
seqint seq = 0No description in source.
shGrossint shGross = 0No description in source.
shFeesint shFees = 0No description in source.
tallyint[] tally = new int[9]No description in source.
mismatchesint mismatches = 0No description in source.
bookSLLongBook book = new SLLongBook()No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
nextRawint nextRaw()No description in source.
rndint rnd(int n)No description in source.
shLotsint shLots()Distinct buys that still hold shares, counted from the per-share ids.
shBuyint shBuy(int day, int qty, int price, int fee)No description in source.
shSellint shSell(int day, int qty, int price, int fee)No description in source.
shCostint shCost()No description in source.
shAgeSumint shAgeSum()No description in source.
agreesboolean agrees()After every step the real book and the shadow must agree on everything observable, and a refused verb must have changed nothing.
runSeedvoid runSeed(int seed, int steps, int bu, int su, int hu)No description in source.
mainvoid main()No description in source.

TaUse15EuclidExhaustive #sleela 3.0 (lib/advantage/trading-actions-on-verb/15-euclid-exhaustive/TaUse15EuclidExhaustive.sleela)

TaUse15EuclidExhaustive class

Euclid, exhaustively: gcd, lcm, Bezout, integer square root, closed-form fills and distance are each checked against a slower independent method over every small case.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
bruteint brute(int a, int b)Brute-force gcd: try every divisor from the larger input downwards.
linearRootint linearRoot(int n)Linear floor square root: grow r while the next square still fits.
mainvoid main()No description in source.

TaUse16ShortOpenAndAdd #sleela 3.0 (lib/advantage/trading-actions-on-verb/16-short-open-and-add/TaUse16ShortOpenAndAdd.sleela)

TaUse16ShortOpenAndAdd class

Trading short, open then add: shortSell verbs build FIFO lots and an average sale price with an exact remainder.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
act2void act2(SLShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse17CoverRealizedPnl #sleela 3.0 (lib/advantage/trading-actions-on-verb/17-cover-realized-pnl/TaUse17CoverRealizedPnl.sleela)

TaUse17CoverRealizedPnl class

Trading short, cover: a partial cover takes the oldest lot first, profit is sale price minus cover price, and borrow cost is charged for the days short.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
act2void act2(SLShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse18RefuseLongAndBadInput #sleela 3.0 (lib/advantage/trading-actions-on-verb/18-refuse-long-and-bad-input/TaUse18RefuseLongAndBadInput.sleela)

TaUse18RefuseLongAndBadInput class

Trading short, refusals: a cover above the shares short, bad inputs, a rate change while short and covers from flat are refused and the book never changes.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.
sQtyint sQty = 0No description in source.
sProceedsint sProceeds = 0No description in source.
sFeesint sFees = 0No description in source.
sDayint sDay = 0No description in source.
sBorrowint sBorrow = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
takevoid take(SLShortBook b)No description in source.
sameboolean same(SLShortBook b)No description in source.
act2void act2(SLShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse19LossAsymmetry #sleela 3.0 (lib/advantage/trading-actions-on-verb/19-loss-asymmetry/TaUse19LossAsymmetry.sleela)

TaUse19LossAsymmetry class

Long versus short risk: a long loss is capped by its cost, a short loss is not capped by its proceeds; markToMarket shows the open loss before any cover.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
act2void act2(SLShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse20BorrowCostAndTimeStop #sleela 3.0 (lib/advantage/trading-actions-on-verb/20-borrow-cost-and-time-stop/TaUse20BorrowCostAndTimeStop.sleela)

TaUse20BorrowCostAndTimeStop class

Time on short: borrow cost is exact per share-day, accrues on open lots, is paid on cover, and a time stop covers shares short too long.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
act2void act2(SLShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse21ShortDifferentialStress #sleela 3.0 (lib/advantage/trading-actions-on-verb/21-short-differential-stress/TaUse21ShortDifferentialStress.sleela)

TaUse21ShortDifferentialStress class

Trading short, differential stress: 1,200 random verbs against SLShortBook and an independent per-share shadow with borrow cost; every observable agrees after every step.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.
stateint state = 1No description in source.
spint[] sp = new int[6000]No description in source.
sdint[] sd = new int[6000]No description in source.
slint[] sl = new int[6000]No description in source.
mint m = 0No description in source.
shLastint shLast = 0No description in source.
seqint seq = 0No description in source.
shGrossint shGross = 0No description in source.
shFeesint shFees = 0No description in source.
shBorrowint shBorrow = 0No description in source.
rateint rate = 2No description in source.
tallyint[] tally = new int[9]No description in source.
mismatchesint mismatches = 0No description in source.
bookSLShortBook book = new SLShortBook()No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
nextRawint nextRaw()No description in source.
rndint rnd(int n)No description in source.
shLotsint shLots()Distinct short sales that still hold shares, counted from the per-share ids.
shShortint shShort(int day, int qty, int price, int fee)No description in source.
shSellint shSell(int day, int qty, int price, int fee)No description in source.
shCostint shCost()No description in source.
shAgeSumint shAgeSum()No description in source.
agreesboolean agrees()After every step the real book and the shadow must agree on everything observable, and a refused verb must have changed nothing.
runSeedvoid runSeed(int seed, int steps, int bu, int su, int hu)No description in source.
mainvoid main()No description in source.

TaUse22MirrorLawStress #sleela 3.0 (lib/advantage/trading-actions-on-verb/22-mirror-law-stress/TaUse22MirrorLawStress.sleela)

TaUse22MirrorLawStress class

Long versus short: the same random verbs drive both books; every status code matches and the short profit is exactly minus the long profit at every step.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.
stateint state = 1No description in source.
tallyint[] tally = new int[9]No description in source.
mismatchesint mismatches = 0No description in source.
lbSLLongBook lb = new SLLongBook()No description in source.
sbSLShortBook sb = new SLShortBook()No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
nextRawint nextRaw()No description in source.
rndint rnd(int n)No description in source.
mirroredboolean mirrored()The mirror law: with the same prices, days and quantities, a buy matches a short sale and a sell matches a cover. Every status code, the shares held, the cost basis and sale proceeds, the ages and the lot count must be equal, and the profit of the short must be exactly minus the long.
runMirrorvoid runMirror(int seed, int steps, int bu, int su, int hu)No description in source.
mainvoid main()No description in source.

TaUse23MarginRequirement #sleela 3.0 (lib/advantage/trading-actions-on-verb/23-margin-requirement/TaUse23MarginRequirement.sleela)

TaUse23MarginRequirement class

Margin arithmetic: the requirement is the exact ceiling of value times percent, computed without a product that could pass the exact-comparison limit.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
directint direct(int value, int bp)No description in source.
mainvoid main()No description in source.

TaUse24MarginCallAndCover #sleela 3.0 (lib/advantage/trading-actions-on-verb/24-margin-call-and-cover/TaUse24MarginCallAndCover.sleela)

TaUse24MarginCallAndCover class

Short margin call: the deposit that restores the margin, and the fewest shares to cover found by binary search and confirmed by a scan; when equity is negative a cover cannot help.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
act2void act2(SLShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse25MarginDifferential #sleela 3.0 (lib/advantage/trading-actions-on-verb/25-margin-differential/TaUse25MarginDifferential.sleela)

TaUse25MarginDifferential class

Margin by differential testing: the binary search for the fewest shares to cover and the closed form for the first call day are each checked against a slow reference over every combination of a grid.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse26MarginAndTime #sleela 3.0 (lib/advantage/trading-actions-on-verb/26-margin-and-time/TaUse26MarginAndTime.sleela)

TaUse26MarginAndTime class

Time on short with margin: borrow cost drains collateral by shares times rate each day, so the first call day has a closed form, confirmed by stepping and by the book's own accrual.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
actvoid act(SLLongBook b, String text, int code)No description in source.
act2void act2(SLShortBook b, String text, int code)No description in source.
mainvoid main()No description in source.

TaUse27BatchReturn #sleela 3.0 (lib/advantage/trading-actions-on-verb/27-batch-return/TaUse27BatchReturn.sleela)

TaUse27BatchReturn class

Use case 27: the batch return over N independent trades, checked against an independent Python model and against real SLLongBook buy/sell pairs, with an explicit refusal of the confusion between a total batch return and a per-trade rate.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectvoid expect(String label, int got, int want)No description in source.
expectTruevoid expectTrue(String label, boolean got)No description in source.
summaryvoid summary()No description in source.
fillAndOverflowint fillAndOverflow()No description in source.
mainvoid main()No description in source.

television-trade #sleela 3.0 (lib/advantage/examples/professional/network-trades/television-trade.sleela)

TelevisionTrade class

NETWORK-TRADE 12 of 12 -- TELEVISION. Scout a network of venue quotes, pick the cheapest buy and dearest sell, negotiate a fair clearing price, and emit a cash receipt. Rung: the top rung: a finished consumer television, fee AND carry.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

trade-exchange #sleela 3.0 (lib/advantage/medium-results/trade-exchange.sleela)

TradeExchange class

MEDIUM-RESULT (Trade). Connect, control, and execute a cross-venue commodity trade over open exchange in the USA using the connect medium and the network subject. Theme: Trade -- routing a lumber lot from the cheapest mill to the dearest buyer.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

trade-math-demo #sleela 3.0 (lib/advantage/math/trade-math-demo.sleela)

TradeMathDemo class

Runnable demonstration + validation of the advantage/math trade subject (joint profit max, Nash bargaining, bilateral newsvendor).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

trader-example #sleela 3.0 (lib/advantage/examples/medium/trade-economics/trader-example.sleela)

TraderExample class

A professional example -- the TRADER -- finds the joint-profit optimum and strikes a Nash-fair wholesale price.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.

trading-demo #sleela 3.0 (lib/advantage/trading/trading-demo.sleela)

TradingDemo class

Runnable demonstration + validation of the advantage/trading subject (eleven trading models, rate budget, and counsel).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passed = 0No description in source.
failedint failed = 0No description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
expectNearvoid expectNear(String label, double got, double want, double tol)---- tiny test harness ----
expectTruevoid expectTrue(String label, boolean cond)No description in source.
expectRejectedvoid expectRejected(String label, SLTradingResult r)A rejected evaluation must carry a reason and report zero everywhere.
mainvoid main()No description in source.

youthfulness-exchange #sleela 3.0 (lib/advantage/medium-results/youthfulness-exchange.sleela)

YouthfulnessExchange class

MEDIUM-RESULT (Youthfulness). A guided, guardrailed first trade for a young/new participant over open US exchange: connect with a disciplined clock, scout a small venue network, negotiate a BUYER-favored price (the newcomer keeps more surplus), and settle a tiny amount with a hard spend cap so a decline is handled safely. Theme: Youthfulness -- learning the exchange with training wheels.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
nearboolean near(double a, double b, double tol)No description in source.
mainvoid main()No description in source.