oracle. Oracles

oracle.Oracles()

Class to support crowdsourcing setting.

This class is a container that support multiple oracles work together. It will store the cost in all and cost for each oracle for analysing.

Methods

oracle.Oracles. init

oracle.Oracles.init(self)

oracle.Oracles. add_oracle

oracle.Oracles.add_oracle(self, oracle_name, oracle_object)

Adding an oracle. The oracle name should be unique to identify different oracles.

Parameters:
oracle_name: str
id of the oracle.
oracle_object: utils.base.BaseOracle
oracle object.

oracle.Oracles. query_from

oracle.Oracles.query_from(self, index_for_querying, oracle_name=None)

query index_for_querying from oracle_name. If oracle_name is not specified, it will query one of the oracles randomly.

Parameters:
index_for_querying: object
index for querying.
oracle_name: str, optional (default=None)
query from which oracle. If not specified, it will query one of the
oracles randomly.
Returns:
sup_info: list
supervised information of queried index.
costs: list
corresponding costs produced by query.

oracle.Oracles. get_oracle

oracle.Oracles.get_oracle(self, oracle_name)

oracle.Oracles. full_history

oracle.Oracles.full_history(self)

return full version of query history

Copyright © 2018, alipy developers (BSD 3 License).