Documentation
¶
Index ¶
- type Demand
- type Market
- func (m *Market) AddDemand(r Requirement, bid float64, retChan chan Supply)
- func (m *Market) AddSupply(supply Supply)
- func (m *Market) FetcherLoop()
- func (m *Market) ReturnSupply(s Supply)
- func (m *Market) SetFetchFunction(fn func([]Demand)) *Market
- func (m *Market) SetScoreFunction(scorer func(Requirement, float64, Object) float64) *Market
- type Object
- type Requirement
- type Supply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Demand ¶
type Demand struct { Requirement Requirement Bid float64 ReturnChan chan Supply }
type Market ¶
type Market struct { Demands []Demand Supplies []Supply Lock sync.Mutex ScoreFn func(Requirement, float64, Object) float64 FetchFn func([]Demand) // contains filtered or unexported fields }
func (*Market) AddDemand ¶
func (m *Market) AddDemand(r Requirement, bid float64, retChan chan Supply)
retChan should be a buffered channel
func (*Market) FetcherLoop ¶
func (m *Market) FetcherLoop()
func (*Market) ReturnSupply ¶
func (*Market) SetFetchFunction ¶
func (*Market) SetScoreFunction ¶
type Requirement ¶
type Requirement interface{}
Click to show internal directories.
Click to hide internal directories.