bpo.predicters module

Classes:

ImbalancedPredicter()

A Predicter that predicts for instances of the ImbalancedProblem.

MeanPredicter()

A Predicter that predicts that the time a resource will take to perform a task is the historical mean.

Predicter()

Abstract class that all predicters must implement.

class bpo.predicters.ImbalancedPredicter[source]

Bases: bpo.predicters.Predicter

A Predicter that predicts for instances of the ImbalancedProblem.

Methods:

predict_next_task(problem, environment)

Predicts the next task that will arrive.

predict_processing_time_task(problem, ...)

Predicts the time it will take a resource to perform a task in a specific problem instance.

predict_remaining_processing_time(problem, ...)

Predicts the time a resource needs to complete a task that was already started.

static predict_next_task(problem, environment)[source]

Predicts the next task that will arrive.

Parameters
  • problem – an instance of a Problem.

  • environment – an instance of a Simulator.

Returns

a task that represents the most likely task to arrive next.

static predict_processing_time_task(problem, resource, task)[source]

Predicts the time it will take a resource to perform a task in a specific problem instance.

Parameters
  • problem – an instance of a Problem.

  • resource – one of the Problem.resources of the problem.

  • task – a Task that should come from the problem.

Returns

a float representing a duration in simulation time.

static predict_remaining_processing_time(problem, resource, task, start_time, now)[source]

Predicts the time a resource needs to complete a task that was already started.

Parameters
  • problem – an instance of a Problem.

  • resource – one of the Problem.resources of the problem.

  • task – a Task that should come from the problem.

  • start_time – the simulation time at which the resource started processing the task.

  • now – the current simulation time.

Returns

a float representing a duration in simulation time.

class bpo.predicters.MeanPredicter[source]

Bases: bpo.predicters.Predicter

A Predicter that predicts that the time a resource will take to perform a task is the historical mean. Works only for instances of the problems.MinedProblem.

Methods:

predict_next_task(problem, environment)

Predicts the next task that will arrive.

predict_processing_time_task(problem, ...)

Predicts the time it will take a resource to perform a task in a specific problem instance.

predict_remaining_processing_time(problem, ...)

Predicts the time a resource needs to complete a task that was already started.

static predict_next_task(problem, environment)[source]

Predicts the next task that will arrive.

Parameters
  • problem – an instance of a Problem.

  • environment – an instance of a Simulator.

Returns

a task that represents the most likely task to arrive next.

static predict_processing_time_task(problem, resource, task)[source]

Predicts the time it will take a resource to perform a task in a specific problem instance.

Parameters
  • problem – an instance of a Problem.

  • resource – one of the Problem.resources of the problem.

  • task – a Task that should come from the problem.

Returns

a float representing a duration in simulation time.

static predict_remaining_processing_time(problem, resource, task, start_time, now)[source]

Predicts the time a resource needs to complete a task that was already started.

Parameters
  • problem – an instance of a Problem.

  • resource – one of the Problem.resources of the problem.

  • task – a Task that should come from the problem.

  • start_time – the simulation time at which the resource started processing the task.

  • now – the current simulation time.

Returns

a float representing a duration in simulation time.

class bpo.predicters.Predicter[source]

Bases: abc.ABC

Abstract class that all predicters must implement.

Methods:

predict_next_task(problem, environment)

Predicts the next task that will arrive.

predict_processing_time_task(problem, ...)

Predicts the time it will take a resource to perform a task in a specific problem instance.

predict_remaining_processing_time(problem, ...)

Predicts the time a resource needs to complete a task that was already started.

abstract static predict_next_task(problem, environment)[source]

Predicts the next task that will arrive.

Parameters
  • problem – an instance of a Problem.

  • environment – an instance of a Simulator.

Returns

a task that represents the most likely task to arrive next.

abstract static predict_processing_time_task(problem, resource, task)[source]

Predicts the time it will take a resource to perform a task in a specific problem instance.

Parameters
  • problem – an instance of a Problem.

  • resource – one of the Problem.resources of the problem.

  • task – a Task that should come from the problem.

Returns

a float representing a duration in simulation time.

abstract static predict_remaining_processing_time(problem, resource, task, start_time, now)[source]

Predicts the time a resource needs to complete a task that was already started.

Parameters
  • problem – an instance of a Problem.

  • resource – one of the Problem.resources of the problem.

  • task – a Task that should come from the problem.

  • start_time – the simulation time at which the resource started processing the task.

  • now – the current simulation time.

Returns

a float representing a duration in simulation time.