nvflare.edge.simulation.simulator module

class Simulator(job_name: str, device_factory: DeviceFactory, num_devices: int = 10000, num_workers: int = 10, get_job_timeout: float = 60.0)[source]

Bases: object

Constructor of Simulator.

Parameters:
  • device_factory – object for creating new devices

  • num_devices – max number of devices to be created

  • num_workers – number of threads for doing tasks

set_send_func(send_f, **kwargs)[source]

Set the function for sending request to Flare

Parameters:
  • send_f – the function to be set

  • **kwargs – args to be passed to the function when invoked

Returns: None

start()[source]
stop()[source]

Stop the simulator.

Returns: None