Package advantage
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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | void check(String what, boolean ok) | No description in source. |
req | SLAdvMessage req(String to, String topic) | No description in source. |
cand | SLAdvMessage 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. |
judgeMsg | SLAdvMessage judgeMsg(SLMoralTrade t) | No description in source. |
main | void 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
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
events | int events = 0 | The program side of the conversation. A module speaks, this is called. |
errors | int errors = 0 | No description in source. |
readyCount | int readyCount = 0 | No description in source. |
vetoes | int vetoes = 0 | No description in source. |
judgedEvents | int judgedEvents = 0 | No description in source. |
lastVerdict | int lastVerdict = -1 | No description in source. |
haltedEvents | int haltedEvents = 0 | No description in source. |
lastTopic | String lastTopic = "" | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
onMessage | int 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
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
br | SLAdvBridge br | No description in source. |
on | boolean on = false | No description in source. |
served | int served = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
moduleName | String moduleName() | No description in source. |
moduleKind | String moduleKind() | No description in source. |
moduleVersion | String moduleVersion() | No description in source. |
running | boolean running() | No description in source. |
begin | boolean begin(SLAdvBridge bridge) | No description in source. |
end | void end() | No description in source. |
handle | int handle(SLAdvMessage m) | No description in source. |
getServed | int 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
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
br | SLAdvBridge br | No description in source. |
on | boolean on = false | No description in source. |
myName | String myName = "ping-a" | No description in source. |
partner | String partner = "ping-b" | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
setNames | void setNames(String mine, String other) | No description in source. |
moduleName | String moduleName() | No description in source. |
moduleKind | String moduleKind() | No description in source. |
moduleVersion | String moduleVersion() | No description in source. |
running | boolean running() | No description in source. |
begin | boolean begin(SLAdvBridge bridge) | No description in source. |
end | void end() | No description in source. |
handle | int 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
student | SLNounRegistry student = new SLNounRegistry() | No description in source. |
master | SLNounRegistry master = new SLNounRegistry() | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
compare | int compare() | Prints each difference and returns the number of differences. |
verdict | void verdict(int diffs) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
reg | SLNounRegistry reg = new SLNounRegistry() | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
tryRegister | void tryRegister(String noun, String carrier) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
reg | SLNounRegistry reg = new SLNounRegistry() | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
loadQuotes | void loadQuotes(boolean discountSeen) | No description in source. |
studentTotal | int studentTotal(String supplier) | The student: a plain sum of every registered value under the supplier. |
masterTotal | int masterTotal(String label, int quote, int fee, int discount) | The Purchase Master: the same figures through the advantage onion. |
pick | String pick(int a, int b) | Tie norm: supplier A is chosen when the two totals are equal. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
reg | SLNounRegistry reg = new SLNounRegistry() | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
tryRegister | void tryRegister(String noun, String carrier) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
reg | SLNounRegistry reg = new SLNounRegistry() | No description in source. |
lastStep | int lastStep = 0 | No description in source. |
good | int good = 0 | No description in source. |
refused | int refused = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
submit | int submit(int step, String claim, String evidence) | Result codes: 0 good, 1 empty claim, 2 evidence not registered, 3 step out of order. |
reason | String reason(int code) | No description in source. |
show | void show(int step, String claim, String evidence) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
names | String[] names = new String[5] | No description in source. |
readings | int[] readings = new int[5] | No description in source. |
minimums | int[] minimums = new int[5] | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
setup | void setup() | No description in source. |
report | void report(int slot, int value) | No description in source. |
status | int status(int slot) | Status codes: 0 ready, 1 not observed, 2 implausible, 3 below minimum. |
word | String word(int code) | No description in source. |
audit | int audit() | Prints the report and returns how many checks are not ready. |
verdict | void verdict(int bad) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
evalsPerSimSecond | int evalsPerSimSecond = 5000 | No description in source. |
maxMinute | double maxMinute = 0.0 | No description in source. |
lastMinute | double lastMinute = 0.0 | No description in source. |
lastPnl | double lastPnl = 0.0 | No description in source. |
lastAccepted | int lastAccepted = 0 | No description in source. |
lastWallSeconds | double lastWallSeconds = 0.0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | void check(String what, boolean ok) | No description in source. |
run | double run(SLHighSpeedTrader tr, SLHstMarket mk, int simSeconds) | No description in source. |
vetoReport | void vetoReport(SLHighSpeedTrader tr, SLHstPragmatics reg) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void main() | No description in source. |
MoralDemo #sleela 3.0 (lib/advantage/modules/moral/MoralDemo.sleela)
MoralDemo class
Runnable check of the Moral Evaluator.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
seed | int seed = 20261113 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | void check(String what, boolean ok) | No description in source. |
rnd | double rnd() | No description in source. |
show | void show(SLMoralEvaluator ev, String label) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
onion | SLAdvantageSequitur onion | ---- Developer-facing engine state ---- |
dividend | SLAdvantageDividend dividend | No description in source. |
passes | int passes | how many inward passes have been run |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
init | void init(String label, String model, int baseValue) | Stand up a fresh engine around a unique dividend wrt a model. |
setOwner | void 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. |
getOwner | String getOwner() | No description in source. |
getOnion | SLAdvantageSequitur getOnion() | Direct access to the layered machine. |
getDividend | SLAdvantageDividend getDividend() | No description in source. |
getPasses | int getPasses() | No description in source. |
setLayer | void setLayer(int depth, int contribution) | ---- Shape the onion: set each stage's signed contribution ---- |
setReview | void setReview(int c) | Named convenience tuners for the standard stages. |
setConcerns | void setConcerns(int c) | No description in source. |
setMaths | void setMaths(int c) | No description in source. |
setAdditions | void setAdditions(int c) | No description in source. |
setSubtraction | void setSubtraction(int c) | No description in source. |
setRegrouping | void setRegrouping(int c) | No description in source. |
setIteration | void setIteration(int c) | No description in source. |
deeper | int deeper() | ---- Navigate the onion by hand ---- |
shallower | int shallower() | No description in source. |
seek | void seek(int d) | No description in source. |
depth | int depth() | No description in source. |
step | void step() | Apply only the layer under the cursor (manual single-step advantaging). |
runPass | int runPass() | Run one complete inward pass over all layers; returns the net advantage. |
iterate | int 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. |
updateModel | void 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. |
favorOwner | int 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. |
restitute | void 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. |
commitBaseline | void commitBaseline() | Commit the current altered state as the NEW restitution baseline, so a later restitute() returns here rather than to the init() state. |
advantage | int advantage() | Current net advantage of the dividend. |
describe | String describe() | No description in source. |
emitThrough | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
label | String label | ---- Dividend state ---- the unique identity of this dividend |
model | String model | the model (frame of reference) it is held with respect to |
owner | String owner | the party to whose advantage the model is tuned |
base | int base | the starting value before any layer is applied |
current | int current | the running value as layers are applied |
originalLabel | String originalLabel | ---- Original snapshot, captured at configure() for full restitute ---- |
originalModel | String originalModel | No description in source. |
originalOwner | String originalOwner | No description in source. |
originalBase | int originalBase | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String lbl, String mdl, int baseValue) | No description in source. |
snapshot | void snapshot() | Record the current identity as the restitution point. |
getLabel | String getLabel() | No description in source. |
getModel | String getModel() | No description in source. |
getOwner | String getOwner() | No description in source. |
setOwner | void setOwner(String o) | No description in source. |
getBase | int getBase() | No description in source. |
getCurrent | int getCurrent() | No description in source. |
setCurrent | void setCurrent(int v) | No description in source. |
updateModel | void 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. |
restitute | void restitute() | ---- Full restitute: restore the dividend to its original identity. ---- |
advantage | int advantage() | The net advantage: how far the dividend has moved from its base. |
rebase | void rebase() | Reset the running value back to the base for a fresh pass. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
sink | SLAdvantageSink sink | No description in source. |
rail | PrintRail rail | reused CommonRails renderer for the commonrails target |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(SLAdvantageSink s) | No description in source. |
getSink | SLAdvantageSink getSink() | No description in source. |
line | void line(String text, int textChars) | Emit a raw line to the sink's target, with its byte length for the socket wire account. |
brandAdvantage | void brandAdvantage() | No description in source. |
state | void state(String label, int labelChars, String message, int messageChars) | No description in source. |
status | void status(String label, String message) | Convenience state() when CommonRails formatting is not needed: no counts. |
report | void report(String subject, String body) | Emit "subject: body". |
pair | void pair(String field, int fieldChars, String value, int valueChars, | No description in source. |
component | void component(String name, int nameChars, int oid, int dateSeq, | No description in source. |
grade | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
depth | int depth | ---- Layer identity and behavior ---- position in the onion; 0 = outermost |
layerName | String layerName | human name of this stage |
kind | String kind | category: value|validate|risk|quant|grow|shrink|reorg|loop |
contribution | int contribution | signed amount this layer applies to the dividend |
visited | boolean visited | has this layer been applied on the current pass |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(int d, String nm, String k, int c) | No description in source. |
getDepth | int getDepth() | No description in source. |
getName | String getName() | No description in source. |
getKind | String getKind() | No description in source. |
getContribution | int getContribution() | No description in source. |
setContribution | void setContribution(int c) | No description in source. |
wasVisited | boolean wasVisited() | No description in source. |
markVisited | void markVisited() | No description in source. |
resetVisit | void resetVisit() | No description in source. |
applyTo | int 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`. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
layers | SLAdvantageLayer[] layers | ---- Onion state ---- the ordered list, index == depth |
count | int count | number of layers in use |
cursor | int cursor | current depth (0..count-1) |
original | int[] original | original per-layer contributions, captured for full restitute |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
buildStandard | void buildStandard() | Build the standard eight-layer Sequitur. Contributions are the DEFAULT shape of the onion; callers may retune any layer via layerAt()/setContribution. |
snapshotShape | void 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. |
size | int size() | No description in source. |
depth | int depth() | No description in source. |
layerAt | SLAdvantageLayer 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). |
canGoInward | boolean canGoInward() | ---- Navigation: iterate further down or up the onion ---- |
canGoOutward | boolean canGoOutward() | No description in source. |
goInward | int goInward() | Move one layer inward (deeper). Returns the new depth. |
goOutward | int goOutward() | Move one layer outward (shallower). Returns the new depth. |
seek | void seek(int d) | Jump the cursor directly to a depth, clamped into range. |
tune | void tune(int d, int contribution) | ---- Tuning: set a layer's contribution by depth ---- |
restitute | void 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. |
favorOwner | int 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. |
totalContribution | int totalContribution() | Sum of every layer's current contribution. |
applyCurrent | void applyCurrent(SLAdvantageDividend div) | Apply the layer at the cursor to the dividend's running value. |
runInwardPass | int 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. |
resetVisits | void resetVisits() | Reset the visited flags on every layer for a fresh pass. |
visitedCount | int 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
target | int target | ---- Sink state ---- |
endpoint | String endpoint | connector identity for the socket target, e.g. "host:port" |
capture | String capture | capture of everything emitted (framed), joined with newlines |
lines | int lines | No description in source. |
connectorOpen | boolean connectorOpen | SOCKET 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). |
bytesWritten | int bytesWritten | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
TERMINAL | int TERMINAL() | ---- Target constants (methods cost no layout slot) ---- |
COMMONRAILS | int COMMONRAILS() | No description in source. |
SOCKET | int SOCKET() | No description in source. |
SILENT | int SILENT() | No description in source. |
configure | void configure(int tgt) | No description in source. |
bindEndpoint | void bindEndpoint(String ep) | For the SOCKET target: name the connector endpoint (modelled, not dialed). (Named bindEndpoint, not connect: connect is a reserved Munction builtin.) |
openConnector | boolean openConnector() | No description in source. |
closeConnector | void closeConnector() | Close the connector (native: slnet_close). Idempotent. |
isOpen | boolean isOpen() | No description in source. |
getTarget | int getTarget() | No description in source. |
getEndpoint | String getEndpoint() | No description in source. |
frameCount | int frameCount() | No description in source. |
getBytesWritten | int getBytesWritten() | No description in source. |
appendFrame | void appendFrame(String framed) | Append to the capture with a separating newline between frames. |
wireWrite | int wireWrite(String framed, int byteCount) | No description in source. |
emit | void emit(String line, int byteCount) | No description in source. |
emitLine | void emitLine(String line) | Backward-compatible emit without a byte count (socket account uses 0 for the body; the endpoint prefix is still counted). |
lastFrame | String lastFrame() | The most recent framed line (empty if nothing emitted). |
drain | String 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). |
targetName | String targetName() | No description in source. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
engine | SLAdvantageDeveloperModel engine | ---- Simple user state (delegates to a hidden developer model) ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
start | void start(String dividendLabel, String model, int baseValue) | Start: name the unique dividend and the model it respects, with a base. |
ownedBy | void ownedBy(String ownerName) | Declare who owns this advantage (the party it is tuned to favor). |
grow | void grow(int amount) | Three plain dials in the user's language. Each maps to onion layers. grow -> additions layer; bigger upside. |
shrink | void shrink(int amount) | shrink -> subtraction layer; a cost or haircut (pass a negative amount). |
rethink | void rethink(int maths, int regroup) | rethink -> maths + regrouping; a quantitative adjustment and a reorg. |
advantage | int advantage() | Press the button: run the whole layered process once and return the net advantage of the dividend with respect to its model. |
advantageHarder | int 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. |
updateModel | void 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. |
favorMe | void favorMe(int strength) | Tip the whole model further in the owner's favor by a simple strength. |
restitute | void restitute() | ---- Full restitute: undo every change, back to the original model ---- |
currentValue | int currentValue() | Read the outcome in plain terms. |
summary | String summary() | No description in source. |
advanced | SLAdvantageDeveloperModel 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
toMod | SLAdvMessage[] toMod | Messages 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. |
toProg | SLAdvMessage[] toProg | No description in source. |
mHead | int mHead = 0 | No description in source. |
mCount | int mCount = 0 | No description in source. |
pHead | int pHead = 0 | No description in source. |
pCount | int pCount = 0 | No description in source. |
cap | int cap = 1024 | No description in source. |
nextId | int nextId = 1 | No description in source. |
posted | int posted = 0 | No description in source. |
dropped | int dropped = 0 | No description in source. |
up | int up = 0 | No description in source. |
down | int down = 0 | No description in source. |
isOpen | boolean isOpen = false | No description in source. |
built | boolean built = false | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
build | void build() | No description in source. |
openBridge | void openBridge() | No description in source. |
shut | void shut() | No description in source. |
opened | boolean opened() | No description in source. |
getPosted | int getPosted() | No description in source. |
getDropped | int getDropped() | No description in source. |
getUp | int getUp() | No description in source. |
getDown | int getDown() | No description in source. |
pendingModules | int pendingModules() | No description in source. |
pendingProgram | int pendingProgram() | No description in source. |
post | int post(SLAdvMessage m) | No description in source. |
nextForModules | SLAdvMessage nextForModules() | No description in source. |
nextForProgram | SLAdvMessage nextForProgram() | No description in source. |
takeReply | SLAdvMessage 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
count | int count() | No description in source. |
nameAt | String nameAt(int i) | No description in source. |
knows | boolean knows(String name) | No description in source. |
create | SLAdvModule 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.
| Method | Signature | What it does |
|---|---|---|
onMessage | int 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
br | SLAdvBridge br | The 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). |
cat | SLAdvCatalog cat | No description in source. |
listener | SLAdvListener listener | No description in source. |
mods | SLAdvModule[] mods | No description in source. |
names | String[] names | No description in source. |
n | int n = 0 | No description in source. |
maxModules | int maxModules = 16 | No description in source. |
up | boolean up = false | No description in source. |
saturated | boolean saturated = false | No description in source. |
routed | int routed = 0 | No description in source. |
unknown | int unknown = 0 | No description in source. |
failures | int failures = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
begin | boolean begin() | No description in source. |
isUp | boolean isUp() | No description in source. |
bridge | SLAdvBridge bridge() | No description in source. |
catalog | SLAdvCatalog catalog() | No description in source. |
count | int count() | No description in source. |
getRouted | int getRouted() | No description in source. |
getUnknown | int getUnknown() | No description in source. |
getFailures | int getFailures() | No description in source. |
wasSaturated | boolean wasSaturated() | No description in source. |
nameAt | String nameAt(int i) | No description in source. |
indexOf | int indexOf(String name) | No description in source. |
has | boolean has(String name) | No description in source. |
find | SLAdvModule find(String name) | No description in source. |
attachListener | void attachListener(SLAdvListener l) | No description in source. |
attach | boolean attach(SLAdvModule m) | No description in source. |
load | boolean load(String name) | Load a catalog module by name and seat it. False when unknown or refused. |
unload | boolean unload(String name) | Unseat a module: it is ended and its slot closed up. |
pumpModules | int pumpModules() | No description in source. |
deliver | int deliver() | No description in source. |
pump | int pump() | No description in source. |
ask | SLAdvMessage ask(SLAdvMessage req) | No description in source. |
tell | int tell(String toName, String topicName, String text) | Send a request without waiting. Returns the id, or -1 when refused. |
shutdown | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
id | int id = 0 | kind: 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. |
inReplyTo | int inReplyTo = 0 | No description in source. |
kind | int kind = 0 | No description in source. |
status | int status = 0 | No description in source. |
from | String from = "" | No description in source. |
to | String to = "" | No description in source. |
topic | String topic = "" | No description in source. |
text | String text = "" | No description in source. |
nums | double[] nums | No description in source. |
count | int count = 0 | No description in source. |
built | boolean built = false | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
build | void build() | No description in source. |
capacity | int capacity() | No description in source. |
size | int size() | No description in source. |
addressed | SLAdvMessage addressed(String fromName, String toName, String topicName, int kindCode) | Address the message. Returns itself so a call can be chained. |
withText | SLAdvMessage withText(String t) | No description in source. |
setNum | boolean setNum(int i, double v) | Set number i (0..47). An out of range index is refused (false). |
num | double num(int i) | Read number i; out of range reads as 0.0. |
numbers | double[] numbers() | No description in source. |
makeReply | SLAdvMessage makeReply(String fromName, String topicName) | No description in source. |
makeError | SLAdvMessage 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.
| Method | Signature | What it does |
|---|---|---|
moduleName | String moduleName(); | No description in source. |
moduleKind | String moduleKind(); | No description in source. |
moduleVersion | String moduleVersion(); | No description in source. |
begin | boolean begin(SLAdvBridge bridge); | No description in source. |
handle | int handle(SLAdvMessage m); | No description in source. |
end | void end(); | No description in source. |
running | boolean 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).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
ev | SLMoralEvaluator ev | Wire 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. |
ts | SLTallScience ts | No description in source. |
led | SLMoralMeritLedger led | No description in source. |
br | SLAdvBridge br | No description in source. |
on | boolean on = false | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
moduleName | String moduleName() | No description in source. |
moduleKind | String moduleKind() | No description in source. |
moduleVersion | String moduleVersion() | No description in source. |
running | boolean running() | No description in source. |
begin | boolean begin(SLAdvBridge bridge) | No description in source. |
end | void end() | No description in source. |
fail | void fail(SLAdvMessage m, int code, String why) | No description in source. |
okReply | SLAdvMessage okReply(SLAdvMessage m) | No description in source. |
handle | int 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).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
tr | SLHighSpeedTrader tr | Wire 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. |
mk | SLHstMarket mk | No description in source. |
br | SLAdvBridge br | No description in source. |
on | boolean on = false | No description in source. |
linked | String linked = "" | No description in source. |
clockMs | double clockMs = 0.0 | No description in source. |
judged | int judged = 0 | No description in source. |
kept | int kept = 0 | No description in source. |
withdrawn | int withdrawn = 0 | No description in source. |
completeN | int completeN = 0 | No description in source. |
facts | double[] facts | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
moduleName | String moduleName() | No description in source. |
moduleKind | String moduleKind() | No description in source. |
moduleVersion | String moduleVersion() | No description in source. |
running | boolean running() | No description in source. |
begin | boolean begin(SLAdvBridge bridge) | No description in source. |
end | void end() | No description in source. |
fail | void fail(SLAdvMessage m, int code, String why) | No description in source. |
okReply | SLAdvMessage okReply(SLAdvMessage m) | No description in source. |
judgeFacts | void judgeFacts(double[] o, SLAdvMessage j) | ---- candidate to trade facts for the linked judge ---- |
handle | int handle(SLAdvMessage m) | No description in source. |
judgedReply | int 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
ax | double ax | ---- 1-form alpha components (a_x, a_y, a_z) ---- |
ay | double ay | No description in source. |
az | double az | No description in source. |
bxy | double bxy | ---- d(alpha) as a constant 2-form (b_xy, b_yz, b_zx) ---- |
byz | double byz | No description in source. |
bzx | double bzx | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
standardForm | void 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). |
configure | void configure(double axv, double ayv, double azv, | Fully general linear form, for experimentation. |
contactVolume | double contactVolume() | The coefficient of alpha ^ d(alpha) as a top 3-form (dx^dy^dz). |
isContact | boolean isContact(double tol) | The contact condition alpha ^ d(alpha) != 0 holds (a genuine, non- integrable announced space where timing/sequence matter). |
moveAllowed | boolean moveAllowed(double vx, double vy, double vz, double tol) | No description in source. |
homotopyResidual | double homotopyResidual(double credibility, double t) | No description in source. |
isNull | boolean 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. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
maxTrades | int maxTrades = 2000000 | These 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. |
maxBp | int maxBp = 1000000 | No description in source. |
maxCapital | int maxCapital = 400000 | No description in source. |
maxExplicitCapital | int 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). |
trades | int[] trades = new int[64] | No description in source. |
tradeCount | int tradeCount = 0 | No description in source. |
explicitCapital | int explicitCapital = 0 | No description in source. |
explicitBatchValid | boolean explicitBatchValid = false | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
addTradeReason | String addTradeReason(int code) | The reason addTrade refused, for the three codes it can return. |
idealBatchInRange | boolean 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). |
idealBatchProfit | int 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). |
idealBatchReturnBp | int 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. |
averagePerTradeBp | int 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. |
startExplicitBatch | boolean 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. |
addTrade | int addTrade(int signedBp) | Result codes: 0 accepted, 1 full (64 already recorded), 2 bp out of range. |
explicitBatchProfit | int 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. |
explicitBatchReturnBp | int explicitBatchReturnBp() | No description in source. |
explicitTradeCount | int explicitTradeCount() | No description in source. |
crossCheckOutcome | int 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). |
crossCheckAgainstLongBook | boolean 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
overageSeller | double overageSeller(double cs, double vs) | ---- Per-side overage and underage costs ---- |
underageSeller | double underageSeller(double price, double cs) | No description in source. |
overageBuyer | double overageBuyer(double price, double vb) | No description in source. |
underageBuyer | double underageBuyer(double r, double price) | No description in source. |
criticalRatio | double criticalRatio(double r, double cs, double vb) | No description in source. |
coordinationGap | double coordinationGap(double r, double cs, double price, double vb) | No description in source. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
units | double units = 0.0 | ---- Trade ledger ---- |
buyPrice | double buyPrice = 0.0 | No description in source. |
sellPrice | double sellPrice = 0.0 | No description in source. |
days | double days = 0.0 | No description in source. |
feeRate | double feeRate = 0.0 | No description in source. |
carryPerUnitDay | double carryPerUnitDay = 0.0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(double u, double buy, double sell, double d) | No description in source. |
setFrictions | void setFrictions(double fee, double carry) | No description in source. |
moneyIn | double moneyIn() | MONEY IN: capital deployed to acquire the units. |
gross | double gross() | Gross cash returned on the sale, before frictions. |
fees | double fees() | Total venue + settlement fees across both legs. |
carry | double carry() | TIME cost: carry (storage / financing) over the holding period. |
cashOut | double cashOut() | CASH FLOW OUT: the net receipt after fees and carry. |
profit | double profit() | Net profit on the round trip. |
returnOnCapital | double returnOnCapital() | Return on capital, as a fraction of money in. |
annualizedRate | double annualizedRate() | Simple time-annualized rate: roc scaled linearly to 365 days. |
receipt | String 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_*).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
vocab | SLConnectStatus vocab | ---- Shared medium plumbing ---- |
fault | SLConnectFault fault | No description in source. |
authority | String authority = "" | ---- Clock state ---- |
configured | boolean configured = false | No description in source. |
open | boolean open = false | No description in source. |
synced | boolean synced = false | No description in source. |
offsetMillis | double offsetMillis = 0.0 | last estimated offset (local - true) in milliseconds |
stratum | int stratum = 16 | NTP stratum of the authority (1 best; 16 unsynchronized) |
syncCount | int syncCount = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
init | void init() | No description in source. |
configure | int configure(String authorityHost) | No description in source. |
openLink | int openLink() | No description in source. |
sync | int sync() | No description in source. |
acceptSync | int acceptSync(double offset, int str) | Host-adapter callback: record a measured discipline result. |
discipline | double discipline(double localEpochMillis) | Correct a local epoch-millis reading by the last measured offset. |
trusted | boolean trusted(int stratumCeiling) | True when the authority is trustworthy enough to rely on (synced and a stratum at or below the accepted ceiling). |
closeLink | int closeLink() | No description in source. |
active | boolean active() | No description in source. |
isSynced | boolean isSynced() | No description in source. |
getStratum | int getStratum() | No description in source. |
getOffsetMillis | double getOffsetMillis() | No description in source. |
isNativeReady | boolean isNativeReady() | No description in source. |
lastFault | SLConnectFault lastFault() | No description in source. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
label | String label | ---- Identity & kind ---- |
kind | int kind | No description in source. |
meaning | String meaning | No description in source. |
relevance | int relevance | No description in source. |
capacity | int capacity | ---- Capacitive space ---- |
used | int used | No description in source. |
children | SLCompartment[] children | ---- Recursive children (its own model) ---- |
childCount | int childCount | No description in source. |
childCap | int childCap | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String lbl, int k, SLIntegrationKind cat) | Configure from a kind, using SLIntegrationKind for defaults. |
getLabel | String getLabel() | No description in source. |
getKind | int getKind() | No description in source. |
getMeaning | String getMeaning() | No description in source. |
getRelevance | int getRelevance() | No description in source. |
getCapacity | int getCapacity() | No description in source. |
getUsed | int getUsed() | No description in source. |
setCapacity | void setCapacity(int c) | No description in source. |
setMeaning | void setMeaning(String m) | No description in source. |
setRelevance | void setRelevance(int r) | No description in source. |
free | int free() | Free space remaining in this compartment's own capacitive space. |
store | int store(int amount) | Fill `amount` units if they fit; returns the amount actually stored. |
release | int release(int amount) | Release `amount` units; returns the amount actually released. |
addChild | void addChild(SLCompartment c) | ---- Recursion: nest a child compartment (its own model) ---- |
getChildCount | int getChildCount() | No description in source. |
childAt | SLCompartment childAt(int i) | No description in source. |
subtreeSize | int subtreeSize() | Total compartments in this subtree, including self (recursive count). |
depth | int depth() | Maximum nesting depth of this subtree (self = depth 1). |
totalCapacity | int totalCapacity() | Aggregate capacity of this subtree (self + all descendants). |
totalUsed | int totalUsed() | Aggregate used units of this subtree. |
totalRelevance | int totalRelevance() | Sum of relevance across this subtree -- a crude "value density". |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
code | int code = 0 | ---- Fault fields ---- |
subsystem | String subsystem = "none" | No description in source. |
operation | String operation = "none" | No description in source. |
message | String message = "" | No description in source. |
retryable | boolean retryable = false | No description in source. |
attempts | int attempts = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
clear | void clear() | Reset to a clean, no-fault state. |
raise | void 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. |
setRetryable | void setRetryable(boolean r) | Let a connector override retryability for domain reasons (e.g. a money DECLINED must never be retried automatically). |
isFaulted | boolean isFaulted() | No description in source. |
getCode | int getCode() | No description in source. |
getSubsystem | String getSubsystem() | No description in source. |
getOperation | String getOperation() | No description in source. |
getMessage | String getMessage() | No description in source. |
isRetryable | boolean isRetryable() | No description in source. |
getAttempts | int getAttempts() | No description in source. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
STATUS_OK | static final int STATUS_OK = 0 | No description in source. |
STATUS_INVALID_ARGUMENT | static final int STATUS_INVALID_ARGUMENT = 1 | No description in source. |
STATUS_INVALID_STATE | static final int STATUS_INVALID_STATE = 2 | No description in source. |
STATUS_NOT_CONFIGURED | static final int STATUS_NOT_CONFIGURED = 3 | No description in source. |
STATUS_UNAUTHORIZED | static final int STATUS_UNAUTHORIZED = 4 | No description in source. |
STATUS_TIMEOUT | static final int STATUS_TIMEOUT = 5 | No description in source. |
STATUS_UNREACHABLE | static final int STATUS_UNREACHABLE = 6 | No description in source. |
STATUS_PROTOCOL | static final int STATUS_PROTOCOL = 7 | No description in source. |
STATUS_DECLINED | static final int STATUS_DECLINED = 8 | No description in source. |
STATUS_NATIVE_ADAPTER_REQUIRED | static final int STATUS_NATIVE_ADAPTER_REQUIRED = 9 | No description in source. |
STATUS_INTERNAL | static final int STATUS_INTERNAL = 10 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
ok | int ok() | Accessor methods so other connectors read codes without cross-class static references (which the semantic checker rejects). |
invalidArgument | int invalidArgument() | No description in source. |
invalidState | int invalidState() | No description in source. |
notConfigured | int notConfigured() | No description in source. |
unauthorized | int unauthorized() | No description in source. |
timeout | int timeout() | No description in source. |
unreachable | int unreachable() | No description in source. |
protocol | int protocol() | No description in source. |
declined | int declined() | No description in source. |
nativeAdapterRequired | int nativeAdapterRequired() | No description in source. |
internal | int internal() | No description in source. |
isOk | boolean isOk(int code) | No description in source. |
isTransient | boolean isTransient(int code) | No description in source. |
name | String 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).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
dailyCap | int dailyCap = 2000 | No description in source. |
maxQty | int maxQty = 100000000 | No description in source. |
maxPrice | int maxPrice = 10000000 | No description in source. |
maxFee | int maxFee = 100000000 | No description in source. |
maxTotal | int maxTotal = 4000000000000000 | No description in source. |
maxDay | int maxDay = 10000000 | No description in source. |
lotQty | int[] lotQty = new int[16] | No description in source. |
lotPrice | int[] lotPrice = new int[16] | No description in source. |
lotDay | int[] lotDay = new int[16] | No description in source. |
count | int count = 0 | No description in source. |
lastDay | int lastDay = 0 | No description in source. |
boughtQty | int boughtQty = 0 | No description in source. |
soldQty | int soldQty = 0 | No description in source. |
boughtCost | int boughtCost = 0 | No description in source. |
costSold | int costSold = 0 | No description in source. |
proceedsTotal | int proceedsTotal = 0 | No description in source. |
feesPaid | int feesPaid = 0 | No description in source. |
lastSaleCost | int lastSaleCost = 0 | No description in source. |
lastSalePnl | int lastSalePnl = 0 | No description in source. |
actionsToday | int actionsToday = 0 | How many actions (of any verb) have been recorded on lastDay so far. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
maxLots | int maxLots() | No description in source. |
reason | String reason(int code) | No description in source. |
totalQty | int totalQty() | No description in source. |
costBasis | int costBasis() | No description in source. |
avgCostFloor | int avgCostFloor() | No description in source. |
avgCostRemainder | int avgCostRemainder() | No description in source. |
lotCount | int lotCount() | No description in source. |
lotQtyAt | int lotQtyAt(int i) | No description in source. |
lotPriceAt | int lotPriceAt(int i) | No description in source. |
lotDayAt | int lotDayAt(int i) | No description in source. |
currentDay | int currentDay() | No description in source. |
actionsOnCurrentDay | int actionsOnCurrentDay() | No description in source. |
remainingToday | int remainingToday() | No description in source. |
admitAction | boolean 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. |
buy | int buy(int day, int qty, int price, int fee) | No description in source. |
sell | int sell(int day, int qty, int price, int fee) | No description in source. |
hold | int hold(int day) | No description in source. |
flatten | int flatten(int day, int price, int fee) | No description in source. |
compact | void compact() | No description in source. |
realizedGross | int realizedGross() | No description in source. |
realizedNet | int realizedNet() | No description in source. |
fees | int fees() | No description in source. |
invariantsHold | boolean 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).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
maxQty | int maxQty = 100000000 | No description in source. |
maxPrice | int maxPrice = 10000000 | No description in source. |
maxFee | int maxFee = 100000000 | No description in source. |
maxTotal | int maxTotal = 4000000000000000 | No description in source. |
maxDay | int maxDay = 10000000 | No description in source. |
maxRate | int maxRate = 1000 | No description in source. |
dailyCap | int dailyCap = 2000 | No description in source. |
lotQty | int[] lotQty = new int[16] | No description in source. |
lotPrice | int[] lotPrice = new int[16] | No description in source. |
lotDay | int[] lotDay = new int[16] | No description in source. |
count | int count = 0 | No description in source. |
lastDay | int lastDay = 0 | No description in source. |
openedQty | int openedQty = 0 | No description in source. |
coveredQty | int coveredQty = 0 | No description in source. |
openedProceeds | int openedProceeds = 0 | No description in source. |
proceedsCovered | int proceedsCovered = 0 | No description in source. |
coverCost | int coverCost = 0 | No description in source. |
feesPaid | int feesPaid = 0 | No description in source. |
borrowRate | int borrowRate = 0 | No description in source. |
borrowPaid | int borrowPaid = 0 | No description in source. |
lastCoverProceeds | int lastCoverProceeds = 0 | No description in source. |
lastCoverPnl | int lastCoverPnl = 0 | No description in source. |
actionsToday | int actionsToday = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
maxLots | int maxLots() | No description in source. |
reason | String reason(int code) | No description in source. |
totalShort | int totalShort() | No description in source. |
proceedsHeld | int proceedsHeld() | No description in source. |
avgSaleFloor | int avgSaleFloor() | No description in source. |
avgSaleRemainder | int avgSaleRemainder() | No description in source. |
lotCount | int lotCount() | No description in source. |
lotQtyAt | int lotQtyAt(int i) | No description in source. |
lotPriceAt | int lotPriceAt(int i) | No description in source. |
lotDayAt | int lotDayAt(int i) | No description in source. |
currentDay | int currentDay() | No description in source. |
actionsOnCurrentDay | int actionsOnCurrentDay() | No description in source. |
remainingToday | int remainingToday() | No description in source. |
admitAction | boolean admitAction(int day) | No description in source. |
setBorrowRate | int setBorrowRate(int rate) | No description in source. |
shortSell | int shortSell(int day, int qty, int price, int fee) | No description in source. |
cover | int cover(int day, int qty, int price, int fee) | No description in source. |
hold | int hold(int day) | No description in source. |
coverAll | int coverAll(int day, int price, int fee) | No description in source. |
compact | void compact() | No description in source. |
realizedGross | int realizedGross() | No description in source. |
realizedNet | int realizedNet() | No description in source. |
fees | int fees() | No description in source. |
borrowCostPaid | int borrowCostPaid() | No description in source. |
invariantsHold | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
fieldName | String fieldName = "" | No description in source. |
n | int n = 0 | No description in source. |
names | String[] names = new String[8] | No description in source. |
q | int[] q = new int[8] | No description in source. |
f | int[] f = new int[8] | No description in source. |
d | int[] d = new int[8] | No description in source. |
sreg | SLNounRegistry sreg = new SLNounRegistry() | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
setup | void setup(String fieldLabel) | No description in source. |
addOption | void addOption(String name, int quote, int fee, int discount) | No description in source. |
masterTotal | int masterTotal(int i) | The Purchase Master: one option through the advantage onion. |
keepFirst | boolean keepFirst(int a, int b) | The tie norm: the first option stays unless the second is strictly cheaper. |
masterPick | int masterPick() | No description in source. |
buildStudent | void 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. |
studentTotal | int studentTotal(int i) | Student total for an option, or -1 when the student did not observe it. |
studentPick | int studentPick() | No description in source. |
pickName | String pickName(int i) | No description in source. |
checkEntry | int checkEntry(String entry, String owner, boolean masterHas, int mv) | Compare one entry: present, carrier and value. Returns 1 when it differs. |
compare | int compare() | Prints every differing entry and returns how many there are. |
showMaster | void showMaster() | No description in source. |
showStudent | void showStudent() | No description in source. |
verdict | boolean verdict() | No description in source. |
slipWords | String slipWords(int kind, int k) | No description in source. |
decide | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
space | SLCompartment space | No description in source. |
yieldPct | int yieldPct | yield as a percentage 0..100: output = input * yield / 100 |
producedTotal | int producedTotal | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String lbl, SLIntegrationKind cat, int yieldPercent) | No description in source. |
getSpace | SLCompartment getSpace() | No description in source. |
getYield | int getYield() | No description in source. |
getProducedTotal | int getProducedTotal() | No description in source. |
load | int load(int units) | Load raw input into the bay's capacitive space; returns units accepted. |
build | int 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. |
freeSpace | int freeSpace() | No description in source. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
maxDiff | int maxDiff = 10000000 | Largest absolute coordinate difference accepted by distSq. |
maxDim | int maxDim = 64 | Largest dimension accepted. maxDiff squared times maxDim = 6.4e15 <= maxExact. |
maxExact | int maxExact = 9007199254740991 | The largest magnitude that every comparison handles exactly (2^53 - 1). |
maxLot | int maxLot = 90000000 | Largest lot size accepted by the fill routines: maxLot squared <= maxExact. |
maxOrder | int maxOrder = 1000000000000 | Largest order accepted by the fill routines. |
maxMag | int maxMag = 9007199254740991 | Largest value lcm may return. |
sqrtCap | int sqrtCap = 94906265 | Largest k with k*k <= maxExact; the search for a floor root never goes above. |
steps | int steps = 0 | Number of loop passes taken by the last gcd call. |
trail | String trail = "" | The remainder trail of the last gcd call, for example 120,180 -> 180,120 |
bx | int bx = 0 | Bezout coefficients from the last egcd call: a*bx + b*by = g. |
by | int by = 0 | No description in source. |
fillA | int fillA = 0 | The fill found by canFill or canFillScan: fillA lots of a plus fillB of b. |
fillB | int fillB = 0 | No description in source. |
fillStatus | int fillStatus = 1 | 0 = a fill exists, 1 = no fill exists, 2 = input out of range. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
abs | int abs(int v) | No description in source. |
gcd | int gcd(int a, int b) | Greatest common divisor of |a| and |b|. gcd(0, 0) is 0. Returns -1 when either magnitude passes maxExact. |
gcdAll | int gcdAll(int[] v, int n) | GCD of the first n values of v. Returns 0 when n is 0 or all are 0. |
lcm | int lcm(int a, int b) | Least common multiple, or -1 when the result would pass maxMag. |
egcd | int 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. |
bezoutHolds | boolean bezoutHolds(int a, int b, int g) | No description in source. |
fillInRange | boolean fillInRange(int c, int a, int b) | No description in source. |
canFill | boolean 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. |
canFillScan | boolean 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. |
isqrt | int 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. |
distSqAt | int 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. |
distSq | int distSq(int[] a, int[] b, int dim) | No description in source. |
dist | int dist(int[] a, int[] b, int dim) | Floor of the Euclidean distance, or -1 on a rejected input. |
nearestIndex | int 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
circuit | SLSophisticationCircuit circuit | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(SLSophisticationCircuit c) | No description in source. |
getCircuit | SLSophisticationCircuit getCircuit() | No description in source. |
all | SLGradeSet all() | ---- Set accessors (each an SLGradeSet with its own rating) ---- |
winning | SLGradeSet winning() | No description in source. |
losing | SLGradeSet losing() | No description in source. |
graders | SLGradeSet graders() | No description in source. |
absolutes | SLGradeSet absolutes() | No description in source. |
overallTier | int overallTier() | Overall field tier 1..10 (the rating of the whole collection). |
overallLetter | String overallLetter() | No description in source. |
winRate | int winRate() | Win rate as a percentage: winning modules over all modules. |
rateSet | String 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. |
championRating | String championRating() | The champion module's rating, or "none" if the field is empty. |
describe | String describe() | No description in source. |
emitThrough | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
name | String name | No description in source. |
grades | SLModuleGrade[] grades | No description in source. |
count | int count | No description in source. |
cap | int cap | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String nm, int capacity) | No description in source. |
getName | String getName() | No description in source. |
size | int size() | No description in source. |
add | void add(SLModuleGrade g) | No description in source. |
at | SLModuleGrade at(int i) | No description in source. |
totalScore | int totalScore() | No description in source. |
meanScore | int meanScore() | Mean score (integer; 0 if empty). |
bestScore | int bestScore() | No description in source. |
worstScore | int worstScore() | No description in source. |
tier | int tier() | Set-level tier 1..10 from the mean score (same scale as a module). |
letter | String letter() | No description in source. |
describe | String 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).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
reg | SLHstPragmatics reg | The 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. |
f | double[] f | No description in source. |
w | double[] w | No description in source. |
hm | double[] hm | No description in source. |
order | int[] order | No description in source. |
vetoCount | int[] vetoCount | No description in source. |
prior | double[] prior | No description in source. |
P | int P = 8 | No description in source. |
ready | boolean ready = false | No description in source. |
halted | boolean halted = false | No description in source. |
threshold | double threshold = 0.60 | No description in source. |
tradesPerMinute | double tradesPerMinute = 2000.0 | No description in source. |
ratePerMs | double ratePerMs = 0.0 | No description in source. |
burst | double burst = 8.0 | No description in source. |
tokens | double tokens = 8.0 | No description in source. |
lastMs | double lastMs = -1.0 | No description in source. |
windowStart | double windowStart = 0.0 | No description in source. |
windowAccepted | int windowAccepted = 0 | No description in source. |
windowRateRej | int windowRateRej = 0 | No description in source. |
evals | int evals = 0 | No description in source. |
accepted | int accepted = 0 | No description in source. |
rejVeto | int rejVeto = 0 | No description in source. |
rejScore | int rejScore = 0 | No description in source. |
rejRate | int rejRate = 0 | No description in source. |
rejNotReady | int rejNotReady = 0 | No description in source. |
lastCode | int lastCode = 1 | No description in source. |
lastBucket | int lastBucket = 0 | No description in source. |
insights | int insights = 0 | No description in source. |
insightsRefused | int insightsRefused = 0 | No description in source. |
lastScore | double lastScore = 0.0 | No description in source. |
pnl | double pnl = 0.0 | No description in source. |
peak | double peak = 0.0 | No description in source. |
ddLimit | double ddLimit = 400.0 | No description in source. |
eta | double eta = 0.10 | No description in source. |
learning | boolean learning = true | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | boolean configure(int pragmatics, double tpm) | No description in source. |
setLearning | void setLearning(boolean on) | No description in source. |
setDrawdownLimit | boolean setDrawdownLimit(double lim) | For comparison runs only: a positive finite drawdown limit in bps. |
getPragmatics | int getPragmatics() | No description in source. |
getThreshold | double getThreshold() | No description in source. |
getEvals | int getEvals() | No description in source. |
getAccepted | int getAccepted() | No description in source. |
getRejVeto | int getRejVeto() | No description in source. |
getRejScore | int getRejScore() | No description in source. |
getRejRate | int getRejRate() | No description in source. |
getVeto | int getVeto(int id) | No description in source. |
getWeight | double getWeight(int id) | No description in source. |
getPnl | double getPnl() | No description in source. |
getLastCode | int getLastCode() | No description in source. |
getLastScore | double getLastScore() | No description in source. |
isHalted | boolean isHalted() | No description in source. |
getInsights | int getInsights() | No description in source. |
getInsightsRefused | int getInsightsRefused() | No description in source. |
resetWindowAccepted | int resetWindowAccepted() | No description in source. |
clamp01 | double clamp01(double x) | ---- small numeric helpers ---- |
okv | boolean okv(double x) | No description in source. |
haltNow | void haltNow() | ---- human control: halt is instant, re-arm is a deliberate human act ---- |
rearm | void rearm() | No description in source. |
insight | boolean insight(int id, double factor) | No description in source. |
refill | void refill(double nowMs) | ---- rate governor: token bucket plus a once a second threshold controller ---- |
features | void features(double[] o) | ---- the 24 features, straight line, each in 0..1 where 1 is best ---- |
evaluate | int evaluate(double[] o, double nowMs) | No description in source. |
learn | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
seed | int seed = 12345 | Deterministic 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. |
real | boolean real = false | No description in source. |
lastE | double lastE = 0.0 | No description in source. |
lastC | double lastC = 0.0 | No description in source. |
lastV | double lastV = 0.0 | No description in source. |
kindCount | int kindCount = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
reseed | void reseed(int s) | No description in source. |
lastWasReal | boolean lastWasReal() | No description in source. |
rnd | double rnd() | No description in source. |
between | double between(double lo, double hi) | No description in source. |
next | void next(double[] o) | Fill o[0..9] with the next candidate. o must have 10 elements. |
realized | double 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
names | String[] names | ids 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. |
hardMins | double[] hardMins | No description in source. |
order | int[] order | No description in source. |
built | boolean built = false | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
build | void build() | No description in source. |
count | int count() | No description in source. |
minPragmatics | int minPragmatics() | No description in source. |
maxPragmatics | int maxPragmatics() | No description in source. |
name | String name(int id) | No description in source. |
hardMin | double hardMin(int id) | No description in source. |
orderAt | int orderAt(int i) | No description in source. |
phase | String 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
nameOf | String nameOf(int kind) | Human name of a kind id. |
defaultCapacityClass | int 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). |
capacityUnits | int capacityUnits(int capClass) | Numeric capacity units implied by a capacity class. |
meaningOf | String meaningOf(int kind) | Meaning: what this kind is FOR (one line). |
relevanceOf | int 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. |
isPlain | boolean isPlain(int kind) | No description in source. |
isRecursive | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
rbA | double rbA | ---- Curve coefficients ---- linear term of buyer revenue R_B(Q) |
rbB | double rbB | quadratic (diminishing) term of buyer revenue |
csA | double csA | linear term of seller cost C_S(Q) |
csB | double csB | quadratic (convex) term of seller cost |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configureCurves | void configureCurves(double rbA0, double rbB0, double csA0, double csB0) | No description in source. |
getRbA | double getRbA() | No description in source. |
getRbB | double getRbB() | No description in source. |
getCsA | double getCsA() | No description in source. |
getCsB | double getCsB() | No description in source. |
buyerRevenue | double buyerRevenue(double q) | Buyer revenue / utility from Q units. |
sellerCost | double sellerCost(double q) | Seller total cost for Q units. |
jointProfit | double jointProfit(double q) | Total available pool of profit: Pi_total(Q) = R_B(Q) - C_S(Q). |
marginalRevenue | double marginalRevenue(double q) | Marginal revenue dR_B/dQ. |
marginalCost | double marginalCost(double q) | Marginal supply cost dC_S/dQ. |
optimalQuantity | double optimalQuantity() | Optimal quantity Q* where MR = MC. 0 if no interior optimum exists. |
maxJointProfit | double maxJointProfit() | The maximum joint surplus, evaluated at Q*. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
maxQty | int maxQty = 100000000 | Largest accepted quantity, price and fee; largest running total. |
maxPrice | int maxPrice = 10000000 | No description in source. |
maxFee | int maxFee = 100000000 | No description in source. |
maxTotal | int maxTotal = 4000000000000000 | No description in source. |
maxDay | int maxDay = 10000000 | Largest day number accepted (about 27,000 years). |
lotQty | int[] lotQty = new int[16] | No description in source. |
lotPrice | int[] lotPrice = new int[16] | No description in source. |
lotDay | int[] lotDay = new int[16] | No description in source. |
count | int count = 0 | No description in source. |
lastDay | int lastDay = 0 | No description in source. |
boughtQty | int boughtQty = 0 | No description in source. |
soldQty | int soldQty = 0 | No description in source. |
boughtCost | int boughtCost = 0 | No description in source. |
costSold | int costSold = 0 | No description in source. |
proceedsTotal | int proceedsTotal = 0 | No description in source. |
feesPaid | int feesPaid = 0 | No description in source. |
lastSaleCost | int lastSaleCost = 0 | Cost basis and pnl of the most recent sell, before fees. |
lastSalePnl | int lastSalePnl = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
maxLots | int maxLots() | No description in source. |
reason | String reason(int code) | No description in source. |
totalQty | int totalQty() | No description in source. |
costBasis | int costBasis() | Cost of what is still held, in cents. |
avgCostFloor | int avgCostFloor() | Average cost per share, rounded down, and the leftover cents. |
avgCostRemainder | int avgCostRemainder() | No description in source. |
lotCount | int lotCount() | No description in source. |
lotQtyAt | int lotQtyAt(int i) | No description in source. |
lotPriceAt | int lotPriceAt(int i) | No description in source. |
lotDayAt | int lotDayAt(int i) | No description in source. |
currentDay | int currentDay() | No description in source. |
buy | int buy(int day, int qty, int price, int fee) | No description in source. |
sell | int 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. |
hold | int hold(int day) | Let time pass with no trade. |
flatten | int flatten(int day, int price, int fee) | Sell everything that is held. |
compact | void compact() | Remove emptied lots, keeping the rest in order. |
realizedGross | int realizedGross() | Realized profit before fees, over everything sold so far. |
realizedNet | int realizedNet() | Realized profit after every fee paid so far, buys and sells. |
fees | int fees() | No description in source. |
validToday | boolean validToday(int today) | True when today is not before the book day, so ages cannot be negative. |
ageOf | int ageOf(int i, int today) | No description in source. |
oldestAge | int oldestAge(int today) | Age of the oldest lot in days, or -1 when flat or when today is invalid. |
weightedAgeFloor | int weightedAgeFloor(int today) | Quantity-weighted average age in whole days, rounded down; 0 when flat, -1 when today is invalid. |
qtyOlderThan | int qtyOlderThan(int today, int maxAge) | Shares held for more than maxAge days. |
isLongTerm | boolean isLongTerm(int i, int today, int threshold) | A lot is long term when it is held for MORE than threshold days. |
qtyLongTerm | int qtyLongTerm(int today, int threshold) | No description in source. |
invariantsHold | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
good | String good | ---- Quote table: parallel arrays, up to 32 venues ---- |
venue | String[] venue = new String[32] | No description in source. |
bid | double[] bid = new double[32] | No description in source. |
ask | double[] ask = new double[32] | No description in source. |
n | int n = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
forGood | void forGood(String g) | No description in source. |
getGood | String getGood() | No description in source. |
count | int count() | No description in source. |
addQuote | void 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. |
bidAt | double bidAt(int i) | No description in source. |
askAt | double askAt(int i) | No description in source. |
venueAt | String venueAt(int i) | No description in source. |
bestAskIndex | int bestAskIndex() | Index of the lowest ask (cheapest place to BUY). -1 if empty. |
bestBidIndex | int bestBidIndex() | Index of the highest bid (best place to SELL). -1 if empty. |
bestAsk | double bestAsk() | No description in source. |
bestBid | double bestBid() | No description in source. |
buyVenue | String buyVenue() | No description in source. |
sellVenue | String sellVenue() | No description in source. |
spread | double spread() | No description in source. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
label | String label | ---- Module grade state ---- |
score | int score | No description in source. |
role | int role | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
ROLE_NORMAL | int ROLE_NORMAL() | role constants (methods cost no layout slot) |
ROLE_GRADER | int ROLE_GRADER() | No description in source. |
ROLE_ABSOLUTE | int ROLE_ABSOLUTE() | No description in source. |
configure | void configure(String lbl, int rawScore, int moduleRole) | No description in source. |
getLabel | String getLabel() | No description in source. |
getScore | int getScore() | No description in source. |
setScore | void setScore(int s) | No description in source. |
getRole | int getRole() | No description in source. |
setRole | void setRole(int r) | No description in source. |
isGrader | boolean isGrader() | No description in source. |
isAbsolute | boolean isAbsolute() | No description in source. |
tier | int 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). |
letter | String letter() | Letter rating from the tier. S is reserved for a perfect/elite tier. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
vocab | SLConnectStatus vocab | ---- Shared medium plumbing ---- |
fault | SLConnectFault fault | No description in source. |
sourceKind | String sourceKind = "" | ---- Funding-source + payment state ---- sourceKind: "bank" | "card" | "wallet" |
keystoreAlias | String keystoreAlias = "" | No description in source. |
currency | String currency = "USD" | No description in source. |
configured | boolean configured = false | No description in source. |
open | boolean open = false | No description in source. |
authorizedCents | int authorizedCents = 0 | No description in source. |
capturedCents | int capturedCents = 0 | No description in source. |
refundedCents | int refundedCents = 0 | No description in source. |
lastDeclined | boolean lastDeclined = false | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
init | void init() | No description in source. |
configure | int configure(String kind, String alias, String cur) | No description in source. |
openLink | int openLink() | No description in source. |
authorize | int authorize(int amountCents) | No description in source. |
acceptAuthorization | int acceptAuthorization(int amountCents) | Host-adapter callback: approval. Records the authorized hold. |
declineAuthorization | int declineAuthorization(String why) | Host-adapter callback: refusal. A decline is NOT retryable. |
capture | int capture(int amountCents) | Capture against a prior authorization (native: slbank_capture). Cannot capture more than was authorized. |
refund | int refund(int amountCents) | Refund part or all of what was captured (native: slbank_refund). |
settledCents | int settledCents() | Net settled amount after refunds, in cents. |
closeLink | int closeLink() | No description in source. |
active | boolean active() | No description in source. |
wasDeclined | boolean wasDeclined() | No description in source. |
getAuthorizedCents | int getAuthorizedCents() | No description in source. |
getCapturedCents | int getCapturedCents() | No description in source. |
getRefundedCents | int getRefundedCents() | No description in source. |
isNativeReady | boolean isNativeReady() | No description in source. |
lastFault | SLConnectFault lastFault() | No description in source. |
receipt | String receipt() | A log-safe settlement receipt -- alias only, never a card number. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
yes | boolean[] yes | The 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. |
dim | int[] dim | No description in source. |
cardinal | boolean[] cardinal | No description in source. |
order | int[] order | No description in source. |
pname | String[] pname | No description in source. |
dimTotal | int[] dimTotal | No description in source. |
dimYes | int[] dimYes | No description in source. |
dimFrac | double[] dimFrac | No description in source. |
active | int active = 41 | No description in source. |
mode | int mode = 3 | No description in source. |
ready | boolean ready = false | No description in source. |
threshold | double threshold = 0.80 | No description in source. |
dimFloor | double dimFloor = 0.50 | No description in source. |
lastMerit | double lastMerit = 0.0 | No description in source. |
lastVerdict | int lastVerdict = 0 | No description in source. |
lastCardinalFail | int lastCardinalFail = -1 | No description in source. |
lastWeakDim | int lastWeakDim = -1 | No description in source. |
lastReason | String lastReason = "not ready" | No description in source. |
reviews | int reviews = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | boolean configure(int points, int verdictStates) | No description in source. |
names | void names() | No description in source. |
getActive | int getActive() | No description in source. |
isReady | boolean isReady() | No description in source. |
getThreshold | double getThreshold() | No description in source. |
getMerit | double getMerit() | No description in source. |
getRisk | double getRisk() | No description in source. |
getVerdict | int getVerdict() | No description in source. |
getReason | String getReason() | No description in source. |
getCardinalFail | int getCardinalFail() | No description in source. |
getWeakDim | int getWeakDim() | No description in source. |
getDimFrac | double getDimFrac(int d) | No description in source. |
getAnswer | boolean getAnswer(int id) | No description in source. |
pointName | String pointName(int id) | No description in source. |
verdictName | String verdictName(int v) | No description in source. |
dimName | String dimName(int d) | No description in source. |
answers | void answers(SLMoralTrade t, SLTallScience ts) | ---- the 41 yes or no answers, straight line ---- |
evaluate | int evaluate(SLMoralTrade t, SLTallScience ts) | No description in source. |
review | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
count | int count = 0 | Overall trades over time: a running record of verdicts and merit. |
nNo | int nNo = 0 | No description in source. |
nYes | int nYes = 0 | No description in source. |
nComplete | int nComplete = 0 | No description in source. |
sumMerit | double sumMerit = 0.0 | No description in source. |
ema | double ema = 0.0 | No description in source. |
minMerit | double minMerit = 1.0 | No description in source. |
weak | int[] weak | No description in source. |
cardinalFails | int[] cardinalFails | No description in source. |
built | boolean built = false | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
build | void build() | No description in source. |
noteTrade | void noteTrade(SLMoralEvaluator ev) | No description in source. |
getCount | int getCount() | No description in source. |
getNo | int getNo() | No description in source. |
getYes | int getYes() | No description in source. |
getComplete | int getComplete() | No description in source. |
meanMerit | double meanMerit() | No description in source. |
recentMerit | double recentMerit() | No description in source. |
worstMerit | double worstMerit() | No description in source. |
riskOfMerit | double riskOfMerit() | No description in source. |
weakCount | int weakCount(int d) | No description in source. |
cardinalCount | int 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
endangersLife | boolean endangersLife = false | The 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. |
humanIsEnd | boolean humanIsEnd = true | No description in source. |
consent | boolean consent = true | No description in source. |
deceptive | boolean deceptive = false | No description in source. |
coerced | boolean coerced = false | No description in source. |
priceRatio | double priceRatio = 1.0 | No description in source. |
hasRemedy | boolean hasRemedy = true | No description in source. |
thirdPartyHarm | boolean thirdPartyHarm = false | No description in source. |
bothBenefit | boolean bothBenefit = true | No description in source. |
exploitsUrgency | boolean exploitsUrgency = false | No description in source. |
coolingOffHours | double coolingOffHours = 24.0 | No description in source. |
decisionMinutes | double decisionMinutes = 30.0 | No description in source. |
timestamped | boolean timestamped = true | No description in source. |
termDays | double termDays = 30.0 | No description in source. |
quoteAgeSeconds | double quoteAgeSeconds = 5.0 | No description in source. |
tradesPerMinute | double tradesPerMinute = 100.0 | No description in source. |
listerIdentified | boolean listerIdentified = true | No description in source. |
listerStanding | double listerStanding = 0.9 | No description in source. |
listingTruthful | boolean listingTruthful = true | No description in source. |
listerProhibited | boolean listerProhibited = false | No description in source. |
provenanceKnown | boolean provenanceKnown = true | No description in source. |
conflictDisclosed | boolean conflictDisclosed = true | No description in source. |
listerCount | int listerCount = 3 | No description in source. |
listerAccountable | boolean listerAccountable = true | No description in source. |
inUsBoundary | boolean inUsBoundary = true | No description in source. |
lawfulSubject | boolean lawfulSubject = true | No description in source. |
sanctionedCounterparty | boolean sanctionedCounterparty = false | No description in source. |
recordsKept | boolean recordsKept = true | No description in source. |
feesAccounted | boolean feesAccounted = true | No description in source. |
manipulative | boolean manipulative = false | No description in source. |
protectionsHonored | boolean protectionsHonored = true | No description in source. |
respectsUS | boolean respectsUS = true | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
wireSize | int wireSize() | No description in source. |
fromNums | boolean fromNums(double[] n) | No description in source. |
toNums | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
curves | SLJointProfitMax curves | ---- Dependencies (sibling-linked within advantage/math) ---- |
mathlib | SLTradeMath mathlib | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(SLJointProfitMax c) | No description in source. |
sellerProfit | double sellerProfit(double price, double q) | Seller profit at wholesale price P and quantity Q: (P*Q) - C_S(Q). |
buyerProfit | double buyerProfit(double price, double q) | Buyer profit at wholesale price P and quantity Q: R_B(Q) - (P*Q). |
nashObjective | double 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. |
nashPrice | double nashPrice(double s0, double b0, double alpha) | No description in source. |
bargainableSurplus | double bargainableSurplus(double s0, double b0) | The joint surplus available for bargaining beyond both reservation points. |
describe | String 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).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
buyerMax | double buyerMax = 0.0 | No description in source. |
sellerMin | double sellerMin = 0.0 | No description in source. |
alpha | double alpha = 0.5 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(double sellerMin0, double buyerMax0, double alpha0) | No description in source. |
hasDeal | boolean hasDeal() | Is there a zone of possible agreement at all? |
zopa | double zopa() | Width of the ZOPA (0 if none). |
clearingPrice | double clearingPrice() | The cleared fair price inside the ZOPA. 0 if no deal. |
sellerSurplus | double sellerSurplus() | Surplus each side keeps at the cleared price. |
buyerSurplus | double buyerSurplus() | No description in source. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
vocab | SLConnectStatus vocab | ---- Shared medium plumbing ---- |
fault | SLConnectFault fault | No description in source. |
host | String host = "" | ---- Endpoint state ---- |
port | int port = 0 | No description in source. |
configured | boolean configured = false | No description in source. |
open | boolean open = false | No description in source. |
reachable | boolean reachable = false | No description in source. |
lastRttMillis | double lastRttMillis = 0.0 | No description in source. |
bytesSent | int bytesSent = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
init | void init() | No description in source. |
configure | int configure(String h, int p) | No description in source. |
openLink | int openLink() | No description in source. |
probe | int probe() | No description in source. |
acceptProbe | int acceptProbe(double rttMillis) | Host-adapter callback: record a measured round-trip time. |
write | int 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. |
closeLink | int closeLink() | No description in source. |
active | boolean active() | No description in source. |
isReachable | boolean isReachable() | No description in source. |
getRttMillis | double getRttMillis() | No description in source. |
getBytesSent | int getBytesSent() | No description in source. |
isNativeReady | boolean isNativeReady() | No description in source. |
lastFault | SLConnectFault lastFault() | No description in source. |
endpoint | String endpoint() | No description in source. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
space | SLCompartment space | No description in source. |
samples | int[] samples | No description in source. |
count | int count | No description in source. |
cap | int cap | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String lbl, SLIntegrationKind cat, int maxSamples) | No description in source. |
getSpace | SLCompartment getSpace() | No description in source. |
getCount | int getCount() | No description in source. |
add | boolean add(int value) | Add a measurement. Returns true if stored. |
sortSamples | void sortSamples() | Insertion sort of the first `count` samples (small trays). |
median | int 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. |
spread | int spread() | Spread = max - min (0 if empty); a wide spread tempers confidence. |
robustness | int robustness() | Robustness score 1..10: more samples and a tighter spread -> higher. A crude heuristic for how trustworthy the median insight is. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
field | String field = "" | No description in source. |
nouns | String[] nouns = new String[32] | No description in source. |
carriers | String[] carriers = new String[32] | No description in source. |
values | int[] values = new int[32] | No description in source. |
count | int count = 0 | No description in source. |
accepted | int accepted = 0 | No description in source. |
refused | int refused = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
declareField | void declareField(String name) | No description in source. |
fieldName | String fieldName() | No description in source. |
size | int size() | No description in source. |
acceptedCount | int acceptedCount() | No description in source. |
refusedCount | int refusedCount() | No description in source. |
nounAt | String nounAt(int i) | No description in source. |
carrierAt | String carrierAt(int i) | No description in source. |
indexOf | int indexOf(String noun) | Returns the index of a noun, or -1 when it is not registered. |
has | boolean has(String noun) | No description in source. |
register | int 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. |
registerValue | int registerValue(String noun, String carrier, int value) | Registers a noun that also holds an integer value, for example cents. |
reason | String reason(int code) | No description in source. |
carrierOf | String carrierOf(String noun) | The immediate carrier, or an empty string when the noun is not observed. |
valueOf | int valueOf(String noun) | The stored value, or -1 when the noun is not observed. Use has() first when -1 could be a real value. |
depthOf | int depthOf(String noun) | Number of hops from the noun up to the field, or -1 when not observed. |
chain | String chain(String noun) | The chain from the noun up to the field, for example: order 2 -> order list -> customer-17 -> (field) |
carries | int carries(String carrier) | How many nouns this carrier holds directly. |
totalUnder | int totalUnder(String carrier) | Sum of the values of every noun this carrier holds, directly or deeper. |
isUnder | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
packageName | String packageName | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String name) | No description in source. |
name | String name() | No description in source. |
available | boolean 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
intToD | double intToD(int n) | No description in source. |
expD | double expD(double x) | No description in source. |
lnD | double lnD(double y) | No description in source. |
powAB | double powAB(double a, double b) | No description in source. |
sqrtD | double sqrtD(double a) | No description in source. |
absD | double 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
maxQty | int maxQty = 100000000 | No description in source. |
maxPrice | int maxPrice = 10000000 | No description in source. |
maxFee | int maxFee = 100000000 | No description in source. |
maxTotal | int maxTotal = 4000000000000000 | No description in source. |
maxDay | int maxDay = 10000000 | No description in source. |
maxRate | int maxRate = 1000 | No description in source. |
lotQty | int[] lotQty = new int[16] | No description in source. |
lotPrice | int[] lotPrice = new int[16] | No description in source. |
lotDay | int[] lotDay = new int[16] | No description in source. |
count | int count = 0 | No description in source. |
lastDay | int lastDay = 0 | No description in source. |
openedQty | int openedQty = 0 | No description in source. |
coveredQty | int coveredQty = 0 | No description in source. |
openedProceeds | int openedProceeds = 0 | No description in source. |
proceedsCovered | int proceedsCovered = 0 | No description in source. |
coverCost | int coverCost = 0 | No description in source. |
feesPaid | int feesPaid = 0 | No description in source. |
borrowRate | int borrowRate = 0 | No description in source. |
borrowPaid | int borrowPaid = 0 | No description in source. |
lastCoverProceeds | int lastCoverProceeds = 0 | Sale proceeds and profit of the most recent cover, before fees and borrow. |
lastCoverPnl | int lastCoverPnl = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
maxLots | int maxLots() | No description in source. |
reason | String reason(int code) | No description in source. |
totalShort | int totalShort() | No description in source. |
proceedsHeld | int proceedsHeld() | Sale proceeds of the shares still short, in cents. |
avgSaleFloor | int avgSaleFloor() | Average sale price per share still short, rounded down, and the remainder. |
avgSaleRemainder | int avgSaleRemainder() | No description in source. |
lotCount | int lotCount() | No description in source. |
lotQtyAt | int lotQtyAt(int i) | No description in source. |
lotPriceAt | int lotPriceAt(int i) | No description in source. |
lotDayAt | int lotDayAt(int i) | No description in source. |
currentDay | int currentDay() | No description in source. |
setBorrowRate | int setBorrowRate(int rate) | The borrow rate can only change while nothing is short, so no share is ever charged at two rates. |
shortSell | int shortSell(int day, int qty, int price, int fee) | No description in source. |
cover | int 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. |
hold | int hold(int day) | No description in source. |
coverAll | int coverAll(int day, int price, int fee) | No description in source. |
compact | void compact() | No description in source. |
realizedGross | int realizedGross() | Profit on shares already covered, before fees and borrow cost. |
realizedNet | int realizedNet() | Cash view: realizedGross - every fee paid - every borrow cost paid. |
fees | int fees() | No description in source. |
borrowCostPaid | int borrowCostPaid() | No description in source. |
markToMarket | int 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. |
validToday | boolean validToday(int today) | No description in source. |
ageOf | int ageOf(int i, int today) | No description in source. |
oldestAge | int oldestAge(int today) | No description in source. |
weightedAgeFloor | int weightedAgeFloor(int today) | No description in source. |
borrowAccrued | int borrowAccrued(int today) | Borrow cost accrued so far on the shares still short, not yet paid. |
qtyOlderThan | int qtyOlderThan(int today, int maxAge) | Shares short for more than maxAge days. |
isLongTerm | boolean 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. |
qtyLongTerm | int qtyLongTerm(int today, int threshold) | No description in source. |
invariantsHold | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
maxValue | int maxValue = 4000000000000000 | No description in source. |
maxBp | int maxBp = 15000 | No description in source. |
maxShares | int maxShares = 100000000 | No description in source. |
maxPrice | int maxPrice = 10000000 | No description in source. |
maxRate | int maxRate = 1000 | No description in source. |
maxDays | int maxDays = 10000000 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
shortValue | int shortValue(int shares, int price) | Short value in cents, or -1 when shares or price are outside their bounds. |
required | int 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. |
equity | int 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. |
inRange | boolean inRange(int collateral, int shares, int price, int bp) | No description in source. |
excess | int excess(int collateral, int shares, int price, int bp) | Excess = equity - required. Answers -2*maxValue when an input is out of range. |
callDue | boolean callDue(int collateral, int shares, int price, int bp) | No description in source. |
callAmount | int callAmount(int collateral, int shares, int price, int bp) | Deposit that restores excess to zero, or 0 when no call is due. |
enoughAfterCover | boolean enoughAfterCover(int collateral, int shares, int price, int bp, int k) | True when covering k shares leaves enough equity for the shares still short. |
sharesToCover | int 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. |
sharesToCoverScan | int sharesToCoverScan(int collateral, int shares, int price, int bp) | Reference: try k = 0, 1, 2, ... up to shares. Used to cross-check. |
daysToCall | int 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. |
daysToCallScan | int 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
modules | SLModuleGrade[] modules | ---- Registered modules ---- |
count | int count | No description in source. |
cap | int cap | No description in source. |
winBar | int winBar | ---- Circuit thresholds ---- |
loseBar | int loseBar | No description in source. |
absoluteBar | int absoluteBar | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(int capacity, int win, int lose, int absolute) | No description in source. |
getWinBar | int getWinBar() | No description in source. |
getLoseBar | int getLoseBar() | No description in source. |
getAbsoluteBar | int getAbsoluteBar() | No description in source. |
register | void register(SLModuleGrade g) | Register a pre-built module grade. |
add | SLModuleGrade add(String label, int score, int role) | Convenience: build and register a module from name/score/role. |
size | int size() | No description in source. |
moduleAt | SLModuleGrade moduleAt(int i) | No description in source. |
buildSet | SLGradeSet 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. |
allModules | SLGradeSet allModules() | No description in source. |
winningModules | SLGradeSet winningModules() | No description in source. |
losingModules | SLGradeSet losingModules() | No description in source. |
graderModules | SLGradeSet graderModules() | No description in source. |
absoluteModules | SLGradeSet absoluteModules() | No description in source. |
champion | SLModuleGrade champion() | The single best module in the field (highest score); null if empty. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
vocab | SLConnectStatus vocab | ---- Shared medium plumbing ---- |
fault | SLConnectFault fault | No description in source. |
host | String host = "" | ---- Connection coordinates + lifecycle ---- |
port | int port = 3306 | No description in source. |
user | String user = "" | No description in source. |
hasSecret | boolean hasSecret = false | No description in source. |
database | String database = "" | No description in source. |
configured | boolean configured = false | No description in source. |
open | boolean open = false | No description in source. |
execCount | int execCount = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
init | void init() | No description in source. |
configure | int 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. |
openLink | int 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. |
ping | int ping() | Liveness check (native: slsql_ping). |
execute | int execute(String sql) | Execute a non-query statement (native: slsql_execute). Needs a host adapter. |
query | int query(String sql) | Run a row-returning query (native: slsql_query). Needs a host adapter. |
closeLink | int closeLink() | Close the link (native: slsql_close). Idempotent. |
active | boolean active() | No description in source. |
isNativeReady | boolean isNativeReady() | No description in source. |
executeCount | int executeCount() | No description in source. |
lastFault | SLConnectFault lastFault() | No description in source. |
coordinate | String coordinate() | A redacted, log-safe coordinate string -- never the user or secret. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
itemName | String 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. |
hasItem | boolean hasItem = false | No description in source. |
inBoundary | boolean inBoundary = false | No description in source. |
respected | boolean respected = false | No description in source. |
nouns | String[] nouns | No description in source. |
names | String[] names | No description in source. |
sci | String[] sci | No description in source. |
mor | String[] mor | No description in source. |
nNouns | int nNouns = 0 | No description in source. |
nNames | int nNames = 0 | No description in source. |
nSci | int nSci = 0 | No description in source. |
nMor | int nMor = 0 | No description in source. |
built | boolean built = false | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
build | void build() | No description in source. |
setItemName | void setItemName(String n) | No description in source. |
setBoundary | void setBoundary(boolean b) | No description in source. |
setRespected | void setRespected(boolean b) | No description in source. |
declareItem | void declareItem() | No description in source. |
countNouns | int countNouns() | No description in source. |
countNames | int countNames() | No description in source. |
countScientific | int countScientific() | No description in source. |
countMoral | int countMoral() | No description in source. |
canonical | boolean canonical() | No description in source. |
paired | boolean paired() | No description in source. |
register | boolean register(int list, String text) | No description in source. |
seed | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
holder | String holder = "Max Rupplin" | No description in source. |
corporation | String corporation = "MEARVK LLC" | No description in source. |
jurisdiction | String jurisdiction = "North Carolina, United States" | No description in source. |
tier | String tier = "Tech Installer II" | No description in source. |
licenceFromYear | int licenceFromYear = 2026 | No description in source. |
licenceToYear | int licenceToYear = 0 | 0 means open-ended (2026 and forward) |
vocab | SLConnectStatus vocab | ---- Shared medium plumbing + install tally ---- |
fault | SLConnectFault fault | No description in source. |
authorized | boolean authorized = false | No description in source. |
installSetCount | int installSetCount = 0 | No description in source. |
settingCount | int settingCount = 0 | No description in source. |
noopCount | int noopCount = 0 | No description in source. |
lastTargetKind | String lastTargetKind = "none" | No description in source. |
lastTargetName | String lastTargetName = "none" | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
init | void init() | No description in source. |
licenceCoversYear | boolean licenceCoversYear(int year) | The licence covers a given calendar year (2026+, open-ended). |
authorize | int authorize(String who, String corp, int year) | No description in source. |
installSet | int installSet(String setName, boolean alreadyPresent) | No description in source. |
applySetting | int applySetting(String settingName, boolean alreadyEqual) | No description in source. |
appliedCount | int appliedCount() | Total distinct installs actually applied (sets + settings, excluding no-ops). |
isAuthorized | boolean isAuthorized() | No description in source. |
getHolder | String getHolder() | No description in source. |
getCorporation2 | String getCorporation2() | No description in source. |
getJurisdiction | String getJurisdiction() | No description in source. |
getTier | String getTier() | No description in source. |
getInstallSetCount | int getInstallSetCount() | No description in source. |
getSettingCount | int getSettingCount() | No description in source. |
getNoopCount | int getNoopCount() | No description in source. |
lastFault | SLConnectFault lastFault() | No description in source. |
credential | String credential() | A log-safe credential card. |
describe | String 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
termPotencyBp | int 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). |
agePotencyBp | int 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). |
atLeastHalfLongTerm | boolean 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. |
termPotencyBp | int termPotencyBp(SLShortBook book, int today, int threshold) | No description in source. |
agePotencyBp | int agePotencyBp(SLShortBook book, int today) | No description in source. |
atLeastHalfLongTerm | boolean 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
intToD | double intToD(int n) | int -> double coercion that works regardless of implicit promotion. |
expD | double expD(double x) | Natural exponential via a truncated Taylor series with range reduction by halving: e^x = (e^(x/2^k))^(2^k). |
lnD | double 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. |
powAB | double powAB(double a, double b) | General power a^b for a > 0 via exp(b * ln a). a <= 0 returns 0. |
sqrtD | double sqrtD(double a) | Convenience square root (powAB with exponent 0.5). |
absD | double 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
evaluate | SLTradingResult 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).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
id | String id = "" | No description in source. |
name | String name = "" | No description in source. |
rewards | double[] rewards | No description in source. |
baselines | double[] baselines | No description in source. |
count | int count = 0 | No description in source. |
capacity | int capacity = 0 | No description in source. |
assumptionsHeld | int assumptionsHeld = 0 | No description in source. |
assumptionsTotal | int assumptionsTotal = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | boolean configure(String approachId, String approachName, int held, int total) | The held count must be between 0 and the total. Returns false otherwise. |
getId | String getId() | No description in source. |
getName | String getName() | No description in source. |
getCount | int getCount() | No description in source. |
getAssumptionsHeld | int getAssumptionsHeld() | No description in source. |
getAssumptionsTotal | int getAssumptionsTotal() | No description in source. |
finiteNumber | boolean finiteNumber(double v) | No description in source. |
addObservation | boolean addObservation(double reward, double baseline) | Record one observation. Rejects non-finite values and a full ledger. |
addTrade | boolean addTrade(SLTradingResult r, double costOfCapital, boolean perUnitCost) | No description in source. |
mean | double mean() | Mean advantage over the evidence; 0.0 when there is none (unknown). |
sqrtD | double sqrtD(double x) | Square root by Newton iteration, so no external math library is needed. |
spread | double spread() | Sample standard deviation of the per-observation advantage; 0.0 below 2. |
confidence | double confidence(double prior) | No description in source. |
trust | double trust() | Share of the assumptions still held; 1.0 when none are recorded. |
score | double score(double prior) | score = mean advantage x confidence x trust |
cautions | String cautions(double prior, int minEvidence) | Plain-language reasons the score should be taken with care. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
inputsOk | boolean inputsOk(double buyPrice, double sellPrice, double quantity, | No description in source. |
totalCost | double totalCost(double buyPrice, double quantity, double buyFeeRate, | No description in source. |
evaluate | SLTradingResult evaluate(double buyPrice, double sellPrice, double quantity, | No description in source. |
breakeven | double 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
pricesOk | boolean 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. |
discount | double discount(double listedPrice, double estimatedValue) | No description in source. |
evaluate | SLTradingResult 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
maxAmount | double maxAmount() | ---- finite bounds (same limits as the C core) ---- |
maxHoldDays | double maxHoldDays() | No description in source. |
probTolerance | double probTolerance() | No description in source. |
maxOutcomes | int maxOutcomes() | No description in source. |
maxLots | int maxLots() | No description in source. |
maxComponents | int maxComponents() | No description in source. |
isFinite | boolean isFinite(double v) | No description in source. |
isAmount | boolean isAmount(double v) | finite and 0 up to the amount cap |
isPositive | boolean isPositive(double v) | finite and strictly above 0, up to the amount cap |
isRate | boolean isRate(double v) | finite, 0 up to but not including 1 |
isProb | boolean isProb(double v) | finite, 0 up to and including 1 |
isDays | boolean isDays(double v) | finite, 0 up to the maximum holding time |
isDistribution | boolean isDistribution(double[] p, int n) | No description in source. |
fail | SLTradingResult fail(String why) | No description in source. |
rangeMessage | String rangeMessage() | Standard messages, shared so every model words its rejections the same. |
distributionMessage | String distributionMessage() | No description in source. |
countMessage | String countMessage() | No description in source. |
finish | SLTradingResult 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
evaluate | SLTradingResult 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
items | SLTradingApproach[] items | No description in source. |
count | int count = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
init | void init() | No description in source. |
size | int size() | No description in source. |
add | boolean add(SLTradingApproach a) | No description in source. |
at | SLTradingApproach at(int i) | No description in source. |
rank | int[] rank(double prior) | No description in source. |
line | String line(int position, int[] order, double prior) | One ranked line for a position in the order returned by rank(). |
cautionsFor | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
evaluate | SLTradingResult 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
quoteOk | boolean quoteOk(double fairValue, double halfSpreadRate) | Symmetric quote around a fair value: bid = fair*(1-h), ask = fair*(1+h). |
bid | double bid(double fairValue, double halfSpreadRate) | No description in source. |
ask | double ask(double fairValue, double halfSpreadRate) | No description in source. |
evaluate | SLTradingResult 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
pow2neg | double 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. |
hypeDecay | double 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. |
evaluate | SLTradingResult 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
limit | double limit = -1.0 | No description in source. |
remaining | double remaining = -1.0 | No description in source. |
resetSeconds | double resetSeconds = -1.0 | No description in source. |
retryAfterSeconds | double retryAfterSeconds = -1.0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
init | void init() | No description in source. |
getLimit | double getLimit() | No description in source. |
getRemaining | double getRemaining() | No description in source. |
getResetSeconds | double getResetSeconds() | No description in source. |
getRetryAfterSeconds | double getRetryAfterSeconds() | No description in source. |
valueOk | boolean 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. |
observe | boolean observe(double limitValue, double remainingValue, | No description in source. |
secondsUntilReset | double secondsUntilReset(double resetValue, double nowEpochSeconds) | No description in source. |
nextDelayMs | double nextDelayMs(double reserve, double minIntervalMs, double maxWaitMs) | No description in source. |
mustStop | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
evaluate | SLTradingResult 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
pricesOk | boolean 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. |
premium | double premium(double buyPrice, double sellPrice) | No description in source. |
evaluate | SLTradingResult 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).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
ok | boolean ok = false | ---- result state ---- |
error | String error = "not evaluated" | No description in source. |
totalCost | double totalCost = 0.0 | No description in source. |
expectedProceeds | double expectedProceeds = 0.0 | No description in source. |
expectedProfit | double expectedProfit = 0.0 | No description in source. |
returnOnCost | double returnOnCost = 0.0 | No description in source. |
holdDays | double holdDays = 0.0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(double cost, double proceeds, double days) | Record a successful evaluation. Profit and return on cost are derived. |
failWith | void 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. |
isOk | boolean isOk() | No description in source. |
getError | String getError() | No description in source. |
getTotalCost | double getTotalCost() | No description in source. |
getExpectedProceeds | double getExpectedProceeds() | No description in source. |
getExpectedProfit | double getExpectedProfit() | No description in source. |
getReturnOnCost | double getReturnOnCost() | No description in source. |
getHoldDays | double getHoldDays() | No description in source. |
rateOk | boolean rateOk(double costOfCapital) | A cost of capital is a yearly fraction between 0 and 10. NaN fails both comparisons, so it is rejected too. |
baseline | double baseline(double costOfCapital) | No description in source. |
advantage | double advantage(double costOfCapital) | No description in source. |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
evaluate | SLTradingResult 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
chk | SLTradingCheck chk | ---- shared validation, created on first use ---- |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | SLTradingCheck check() | No description in source. |
evaluate | SLTradingResult 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
tau0 | double tau0 | ---- Trust field tau(x,y) = tau0 + gx*x + gy*y (clamped) ---- |
gx | double gx | No description in source. |
gy | double gy | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configureField | void configureField(double tau0v, double gxv, double gyv) | No description in source. |
tauAt | double tauAt(double x, double y) | No description in source. |
phiX | double phiX(double x, double y) | phi gradients: phi_x = -0.5 * gx / tau, phi_y = -0.5 * gy / tau. |
phiY | double phiY(double x, double y) | No description in source. |
acceleration | double[] 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). |
geodesicLength | double geodesicLength(double x0, double y0, double x1, double y1, | No description in source. |
euclidean | double euclidean(double x0, double y0, double x1, double y1, SLPhysicsMath m) | Convenience: the straight-line Euclidean distance (flat-field reference). |
isStraightLine | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
space | SLCompartment space | No description in source. |
outcomes | int[] outcomes | No description in source. |
count | int count | No description in source. |
cap | int cap | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String lbl, SLIntegrationKind cat, int maxTrials) | No description in source. |
getSpace | SLCompartment getSpace() | No description in source. |
getCount | int getCount() | No description in source. |
logTrial | boolean logTrial(int score) | Record a trial outcome score. Returns true if recorded (space remained). (Named logTrial, not record: `record` is a reserved SLeeLa keyword.) |
passing | int passing(int threshold) | How many recorded trials met or exceeded a pass threshold. |
successRate | int successRate(int threshold) | Success rate as a percentage 0..100 at a threshold (0 if no trials). |
meanScore | int meanScore() | Mean outcome score (integer division; 0 if no trials). |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
kappa | double kappa | ---- Parameters ---- mean-reversion speed |
tauBar | double tauBar | long-run baseline trust |
sigma | double sigma | diffusion (noise) scale |
delta | double delta | jump size of a breach (trust lost per jump) |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(double k, double tb, double s, double d) | No description in source. |
clamp | double clamp(double t) | Keep trust in [0,1] (a trust probability/parameter). |
step | double step(double tau, double dt, double dW, double dJ, SLPhysicsMath m) | No description in source. |
expectedStep | double expectedStep(double tau, double dt) | The deterministic (expected) step: dW=0, no jump. tau_{t+dt} = tau + kappa(tauBar - tau) dt. |
expectedPath | double expectedPath(double tau0, double dt, int n) | No description in source. |
breach | double breach(double tau) | No description in source. |
describe | String 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
conformalFactor | double conformalFactor(double tau) | Conformal factor f(tau) = 1/tau. Clamps tiny tau to avoid overflow. |
metricAt | double[] metricAt(double tau) | Build the 2x2 metric at a given trust level into a flat double[4]. |
lineElementSq | double 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. |
effectiveDistance | double 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. |
warping | double 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. |
isFlat | boolean isFlat(double tau, double tol) | Is the field effectively flat (Euclidean) at this trust level? |
describe | String 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
name | String name | No description in source. |
cat | SLIntegrationKind cat | No description in source. |
tiers | SLCompartment[] tiers | the vertical stack, index 0 = most upstream |
tierCount | int tierCount | No description in source. |
tierCap | int tierCap | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String nm) | No description in source. |
getName | String getName() | No description in source. |
catalog | SLIntegrationKind catalog() | No description in source. |
getTierCount | int getTierCount() | No description in source. |
addTier | int addTier(SLCompartment tier) | Append a tier downstream. Returns its tier index (0 = most upstream). |
addKind | SLCompartment addKind(String label, int kind) | Build and append a tier of a given kind in one call; returns the tier. |
tierAt | SLCompartment tierAt(int i) | No description in source. |
flowDownstream | int 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. |
runChain | int runChain(int amount) | Run one full upstream->downstream sweep moving `amount` per hop. Returns the units delivered into the most downstream (retail) tier. |
totalCompartments | int totalCompartments() | ---- Aggregates over the whole recursive tree ---- |
totalCapacity | int totalCapacity() | No description in source. |
totalUsed | int totalUsed() | No description in source. |
totalRelevance | int totalRelevance() | No description in source. |
maxDepth | int maxDepth() | Maximum recursion depth across all tiers (how deep the nesting goes). |
sophistication | int sophistication() | No description in source. |
utilization | int utilization() | Utilization percentage of the whole tree (0 if no capacity). |
describe | String describe() | No description in source. |
emitThrough | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLDailyCapShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
sQty | int sQty = 0 | No description in source. |
sCost | int sCost = 0 | No description in source. |
sFees | int sFees = 0 | No description in source. |
sDay | int sDay = 0 | No description in source. |
sLots | int sLots = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
take | void take(SLLongBook b) | No description in source. |
same | boolean same(SLLongBook b) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
state | int state = 1 | No description in source. |
sp | int[] sp = new int[6000] | No description in source. |
sd | int[] sd = new int[6000] | No description in source. |
sl | int[] sl = new int[6000] | No description in source. |
m | int m = 0 | No description in source. |
shLast | int shLast = 0 | No description in source. |
seq | int seq = 0 | No description in source. |
shGross | int shGross = 0 | No description in source. |
shFees | int shFees = 0 | No description in source. |
tally | int[] tally = new int[9] | No description in source. |
mismatches | int mismatches = 0 | No description in source. |
book | SLLongBook book = new SLLongBook() | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
nextRaw | int nextRaw() | No description in source. |
rnd | int rnd(int n) | No description in source. |
shLots | int shLots() | Distinct buys that still hold shares, counted from the per-share ids. |
shBuy | int shBuy(int day, int qty, int price, int fee) | No description in source. |
shSell | int shSell(int day, int qty, int price, int fee) | No description in source. |
shCost | int shCost() | No description in source. |
shAgeSum | int shAgeSum() | No description in source. |
agrees | boolean agrees() | After every step the real book and the shadow must agree on everything observable, and a refused verb must have changed nothing. |
runSeed | void runSeed(int seed, int steps, int bu, int su, int hu) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
brute | int brute(int a, int b) | Brute-force gcd: try every divisor from the larger input downwards. |
linearRoot | int linearRoot(int n) | Linear floor square root: grow r while the next square still fits. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
act2 | void act2(SLShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
act2 | void act2(SLShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
sQty | int sQty = 0 | No description in source. |
sProceeds | int sProceeds = 0 | No description in source. |
sFees | int sFees = 0 | No description in source. |
sDay | int sDay = 0 | No description in source. |
sBorrow | int sBorrow = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
take | void take(SLShortBook b) | No description in source. |
same | boolean same(SLShortBook b) | No description in source. |
act2 | void act2(SLShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
act2 | void act2(SLShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
act2 | void act2(SLShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
state | int state = 1 | No description in source. |
sp | int[] sp = new int[6000] | No description in source. |
sd | int[] sd = new int[6000] | No description in source. |
sl | int[] sl = new int[6000] | No description in source. |
m | int m = 0 | No description in source. |
shLast | int shLast = 0 | No description in source. |
seq | int seq = 0 | No description in source. |
shGross | int shGross = 0 | No description in source. |
shFees | int shFees = 0 | No description in source. |
shBorrow | int shBorrow = 0 | No description in source. |
rate | int rate = 2 | No description in source. |
tally | int[] tally = new int[9] | No description in source. |
mismatches | int mismatches = 0 | No description in source. |
book | SLShortBook book = new SLShortBook() | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
nextRaw | int nextRaw() | No description in source. |
rnd | int rnd(int n) | No description in source. |
shLots | int shLots() | Distinct short sales that still hold shares, counted from the per-share ids. |
shShort | int shShort(int day, int qty, int price, int fee) | No description in source. |
shSell | int shSell(int day, int qty, int price, int fee) | No description in source. |
shCost | int shCost() | No description in source. |
shAgeSum | int shAgeSum() | No description in source. |
agrees | boolean agrees() | After every step the real book and the shadow must agree on everything observable, and a refused verb must have changed nothing. |
runSeed | void runSeed(int seed, int steps, int bu, int su, int hu) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
state | int state = 1 | No description in source. |
tally | int[] tally = new int[9] | No description in source. |
mismatches | int mismatches = 0 | No description in source. |
lb | SLLongBook lb = new SLLongBook() | No description in source. |
sb | SLShortBook sb = new SLShortBook() | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
nextRaw | int nextRaw() | No description in source. |
rnd | int rnd(int n) | No description in source. |
mirrored | boolean 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. |
runMirror | void runMirror(int seed, int steps, int bu, int su, int hu) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
direct | int direct(int value, int bp) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
act2 | void act2(SLShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
act | void act(SLLongBook b, String text, int code) | No description in source. |
act2 | void act2(SLShortBook b, String text, int code) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expect | void expect(String label, int got, int want) | No description in source. |
expectTrue | void expectTrue(String label, boolean got) | No description in source. |
summary | void summary() | No description in source. |
fillAndOverflow | int fillAndOverflow() | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void 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).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed = 0 | No description in source. |
failed | int failed = 0 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
expectNear | void expectNear(String label, double got, double want, double tol) | ---- tiny test harness ---- |
expectTrue | void expectTrue(String label, boolean cond) | No description in source. |
expectRejected | void expectRejected(String label, SLTradingResult r) | A rejected evaluation must carry a reason and report zero everywhere. |
main | void 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.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
near | boolean near(double a, double b, double tol) | No description in source. |
main | void main() | No description in source. |