This module describes the Supply Chain Management League Platform as run in 2019

scml.scml2019 Package

The implementation file for all entities needed for ANAC-SCML 2019.

Participants need to provide a class inherited from FactoryManager that implements all of its abstract functions.

Participants can optionally override any other methods of this class or implement new NegotiatorUtility class.

Simulation steps:

  1. prepare custom stats (call _pre_step_stats)

  2. sign contracts that are to be signed at this step calling on_contract_signed as needed

  3. step all existing negotiations negotiation_speed_multiple times handling any failed negotiations and creating contracts for any resulting agreements

  4. run all Entity objects registered (i.e. all agents). Consumer s run first then FactoryManager s then Miner s

  5. execute contracts that are executable at this time-step handling any breaches

  6. Custom Simulation Steps:
    1. step all factories (Factory objects) running any pre-scheduled commands

    2. Apply interests and pay loans

    3. remove expired CFP s

    4. Deliver any products that are in transportation

  7. remove any negotiations that are completed!

  8. update basic stats

  9. update custom stats (call _post_step_stats)

Remarks about re-negotiation on breaches:

  • The victim is asked first to specify the negotiation agenda (issues) then the perpetrator

  • renegotiations for breaches run immediately to completion independent from settings of negotiation_speed_multiplier and immediate_negotiations. That include conclusion and signing of any resulting agreements.

Remarks about timing:

  • The order of events within a single time-step are as follows:

    1. Contracts scheduled to be signed are signed.

    2. Scheduled negotiations run for the predefined number of steps. Any negotiation that result in a contract or fail may trigger other negotiations.

    3. If immediate_negotiations, some of the newly added negotiations may be concluded/failed.

    4. Any newly concluded contracts that are to be signed at this step are signed

    5. Contracts are executed including full execution of any re-negotiations and breaches are handled. Notice that if re-negotiation leads to new contracts, these will be concluded and signed immediately at this step. Please note the following about contract execution:

      • Products are moved from the seller’s storage to a temporary truck as long as they are available at the time of contract execution. Because contract execution happens before actual production, outputs from production processes CANNOT be sold at the same time-step.

    6. Production is executed on all factories. For a Process to start/continue on a Line, all its inputs required at this time-step MUST be available in storage of the corresponding factory by this point. This implies that it is impossible for any processes to start at time-step 0 except if initial storage was nonzero. FactoryManager s are informed about processes that cannot start due to storage or fund shortage (or cannot continue due to storage shortage) through an on_production_failure call.

    7. Outputs of the Process are generated at the end of the corresponding time-step. It is immediately moved to storage. Because outputs are generated at the end of the step and inputs are consumed at the beginning, a factory cannot use outputs of a process as inputs to another process that starts at the same time-step.

    8. Products are moved from the temporary truck to the buyer’s storage after the transportation_delay have passed at the end of the time-step. Transportation completes at the end of the time-step no matter what is the value for transportation_delay. This means that if a FactoryManager believes that it can produce some product at time t, it should never contract to sell it before t+d + 1 where d is the transportation_delay (the 1 comes from the fact that contract execution happens before production). Even for a zero transportation delay, you cannot produce something and sell it in the same time-step. Moreover, the buyer should never use the product to be delivered at time t as an input to a production process that needs it before step t+1.

    9. When contracts are executed, the funds are deducted from the buyer’s wallet at the beginning of the simulation step and deposited in the seller’s wallet at the end of that step (similar to what happens to the products). This means that a factory manager cannot use funds it receives from sales at time t for buying products before t + 1.

Remarks about ANAC 2019 SCML League:

Given the information above, and settings for the ANAC 2019 SCML you can confirm for yourself that the following rules are all correct:

  1. No agents except miners should contract on delivery at time 0.

  2. FactoryManager s should never sign contracts to sell the output of their production with delivery at t except if this production starts at step t and the contract is signed no later than than t-1.

  3. If not all inputs are available in storage, FactoryManager s should never sign contracts to sell the output of production with delivery at t later than t-2 (and that is optimistic).



Runs the simulated actions then confirms them if they are not rolled back


Runs the simulated actions then rolls them back

anac2019_world([competitors, params, …])

Creates a world compatible with the ANAC 2019 competition.

anac2019_tournament(competitors[, …])

The function used to run ANAC 2019 SCML tournament (collusion track).

anac2019_collusion(competitors[, …])

The function used to run ANAC 2019 SCML tournament (collusion track).

anac2019_std(competitors[, …])

The function used to run ANAC 2019 SCML tournament (standard track).

balance_calculator(worlds, scoring_context, …)

A scoring function that scores factory managers’ performance by the final balance only ignoring whatever still in their inventory.

anac2019_sabotage(competitors[, …])

The function used to run ANAC 2019 SCML tournament (collusion track).

pos_gauss(mu, sigma)

Returns a sample from a rectified gaussian

_safe_max(a, b)


Finds all runs of zero in an array


Product(id, production_level, name, …)

Process(id, production_level, name, inputs, …)

InputOutput(product, quantity, step)

An input/output to a production process

RunningCommandInfo(profile, beg, end, step, …)

ManufacturingProfile(n_steps, cost, …)

The costs/time required for running a process on a line (with associated cancellation costs etc).

ManufacturingProfileCompiled(n_steps, cost, …)

The costs/time required for running a process on a line (with associated cancellation costs etc).

ProductManufacturingInfo(profile, quantity, step)

Gives full information about a manufacturing process that can generate or consume a product.

FactoryStatusUpdate(balance, storage)

Job(profile, time, line, action, contract, …)

Describes a job to be run on one production line of a Factory.

ProductionNeed(product, needed_for, …)

Describes some quantity of a product that is needed to honor a (sell) contract.

MissingInput(product, quantity)

ProductionReport(line, started, continuing, …)

ProductionFailure(line, command, …)

FinancialReport(agent, step, cash, …)

Reports that financial standing of an agent at a given time in the simulation

SCMLAgreement(time, unit_price, quantity[, …])

SCMLAction(line, profile, action[, time])

CFP(is_buy, publisher, product, time, …[, …])

A Call for proposal upon which a negotiation can start

Loan(amount, starts_at, total, interest, …)

InsurancePolicy(premium, contract, at_time, …)

Factory(initial_storage[, initial_wallet, …])

Represents a factory within an SCML world.

FactoryState(max_storage, line_schedules, …)

Read Only State of a factory

SCMLAWI(world, agent)

A single contact point between SCML agents and the world simulation.

FactoryManager([name, simulator_type])

Base factory manager class that will be inherited by participant negmas in ANAC 2019.

DoNothingFactoryManager([name, simulator_type])

The default factory manager that will be implemented by the committee of ANAC-SCML 2019

GreedyFactoryManager([name, simulator_type, …])

The default factory manager that will be implemented by the committee of ANAC-SCML 2019

JavaFactoryManager([java_object, …])

Allows factory managers implemented in Java (using jnegmas) to participate in SCML worlds.


JavaGreedyFactoryManager([auto_load_java, …])

JavaDummyMiddleMan([auto_load_java, name, …])

DefaultBank(minimum_balance, interest_rate, …)

Represents a bank in the world

Bank(*args, **kwargs)

Base class for all banks

DefaultInsuranceCompany(premium, …[, …])

Represents an insurance company in the world

InsuranceCompany(*args, **kwargs)

Base class for all insurance companies

SCML2019Agent([name, ufun])

The base for all SCM Agents

FactorySimulator(initial_wallet, …[, …])

Simulates a factory allowing for prediction of storage/balance in the future.

SlowFactorySimulator(initial_wallet, …)

A slow factory simulator that runs an internal factory to find-out what will happen in the future

FastFactorySimulator(initial_wallet, …)

A faster implementation of the FactorySimulator interface (compared with SlowFactorySimulator.

DefaultGreedyManager(*args[, …])

ScheduleInfo(final_balance[, valid, start, …])

Scheduler(manager_id, awi[, …])

Base class for all schedulers

GreedyScheduler(manager_id, awi[, …])

Default scheduler used by the DefaultFactoryManager

SCML2019World(products, processes, …[, …])

The SCML2020World class running a simulation of supply chain management.

Factory(initial_storage[, initial_wallet, …])

Represents a factory within an SCML world.

Consumer([name, ufun])

Base class of all consumer classes

ConsumptionProfile([schedule, …])

JustInTimeConsumer([profiles, …])

Consumer class

Miner([name, ufun])

Base class of all miners

MiningProfile([cv, alpha_t, alpha_q, …])

ReactiveMiner([profiles, negotiator_type, …])

Raw Material Generator

Class Inheritance Diagram

Inheritance diagram of scml.scml2019.common.Product, scml.scml2019.common.Process, scml.scml2019.common.InputOutput, scml.scml2019.common.RunningCommandInfo, scml.scml2019.common.ManufacturingProfile, scml.scml2019.common.ManufacturingProfileCompiled, scml.scml2019.common.ProductManufacturingInfo, scml.scml2019.common.FactoryStatusUpdate, scml.scml2019.common.Job, scml.scml2019.common.ProductionNeed, scml.scml2019.common.MissingInput, scml.scml2019.common.ProductionReport, scml.scml2019.common.ProductionFailure, scml.scml2019.common.FinancialReport, scml.scml2019.common.SCMLAgreement, scml.scml2019.common.SCMLAction, scml.scml2019.common.CFP, scml.scml2019.common.Loan, scml.scml2019.common.InsurancePolicy, scml.scml2019.common.Factory, scml.scml2019.common.FactoryState, scml.scml2019.awi.SCMLAWI, scml.scml2019.factory_managers.builtins.FactoryManager, scml.scml2019.factory_managers.builtins.DoNothingFactoryManager, scml.scml2019.factory_managers.builtins.GreedyFactoryManager, scml.scml2019.factory_managers.builtins.JavaFactoryManager, scml.scml2019.factory_managers.builtins.JavaDoNothingFactoryManager, scml.scml2019.factory_managers.builtins.JavaGreedyFactoryManager, scml.scml2019.factory_managers.builtins.JavaDummyMiddleMan,,,,, scml.scml2019.agent.SCML2019Agent, scml.scml2019.simulators.FactorySimulator, scml.scml2019.simulators.SlowFactorySimulator, scml.scml2019.simulators.FastFactorySimulator, scml.scml2019.utils.DefaultGreedyManager, scml.scml2019.schedulers.ScheduleInfo, scml.scml2019.schedulers.Scheduler, scml.scml2019.schedulers.GreedyScheduler,, scml.scml2019.common.Factory, scml.scml2019.consumers.Consumer, scml.scml2019.consumers.ConsumptionProfile, scml.scml2019.consumers.JustInTimeConsumer, scml.scml2019.miners.Miner, scml.scml2019.miners.MiningProfile, scml.scml2019.miners.ReactiveMiner