Documentation ¶
Index ¶
- type DecisionMaker
- type Equip
- type Manager
- type Negotiation
- func (n *Negotiation) End() bool
- func (n *Negotiation) ManagerXLeftRight(idx int) (l, r float64)
- func (n *Negotiation) ManagerY() float64
- func (n *Negotiation) ProposalStartPosition(idx int) geom.PointF
- func (n *Negotiation) Reset(money int)
- func (n *Negotiation) UpdateDecisionMaker(decisionMakerX float64)
- func (n *Negotiation) UpdateOthers()
- type Proposal
- func (p *Proposal) AddRotateVelocity(v float64)
- func (p *Proposal) BoundBottom(y float64)
- func (p *Proposal) BoundLeft(x float64)
- func (p *Proposal) BoundRight(x float64)
- func (p *Proposal) BoundTop(y float64)
- func (p *Proposal) Clone() *Proposal
- func (p *Proposal) ImageName() string
- func (p *Proposal) MultiplyVelocity(v float64)
- func (p *Proposal) Update()
- type ProposalProcessor
- type ProposalProcessorAccelerate
- type ProposalProcessorCustomImageName
- type ProposalProcessorImprove
- type ProposalProcessorReduceCost
- type ProposalProcessorRotate
- type ProposalProcessorStopRotate
- type Vendor
- type VendorSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DecisionMaker ¶
type DecisionMaker struct { LeftX float64 Width float64 Y float64 LinearFn geom.LinearFunc }
func NewDecisionMaker ¶
func NewDecisionMaker(leftX float64, width float64) *DecisionMaker
func (*DecisionMaker) Left ¶
func (d *DecisionMaker) Left() geom.PointF
func (*DecisionMaker) Right ¶
func (d *DecisionMaker) Right() geom.PointF
func (*DecisionMaker) Update ¶
func (d *DecisionMaker) Update(xCenter float64)
type Equip ¶
func (Equip) CalcedImprovedCount ¶
type Manager ¶
type Manager struct { Name string Processors []ProposalProcessor }
func NewManager ¶
func NewManager(name string, processors ...ProposalProcessor) *Manager
type Negotiation ¶
type Negotiation struct { Size geom.PointF DecisionMaker *DecisionMaker VendorSelector *VendorSelector LastSelectedVendor *Vendor Managers []*Manager Money int ProposalDelay *Proposal Proposals []*Proposal ApprovedEquips []*Equip }
func (*Negotiation) End ¶
func (n *Negotiation) End() bool
func (*Negotiation) ManagerXLeftRight ¶
func (n *Negotiation) ManagerXLeftRight(idx int) (l, r float64)
func (*Negotiation) ManagerY ¶
func (n *Negotiation) ManagerY() float64
func (*Negotiation) ProposalStartPosition ¶
func (n *Negotiation) ProposalStartPosition(idx int) geom.PointF
func (*Negotiation) Reset ¶
func (n *Negotiation) Reset(money int)
func (*Negotiation) UpdateDecisionMaker ¶
func (n *Negotiation) UpdateDecisionMaker(decisionMakerX float64)
func (*Negotiation) UpdateOthers ¶
func (n *Negotiation) UpdateOthers()
type Proposal ¶
type Proposal struct { Equip *Equip Cost int Hit geom.Circle Velocity geom.PointF Rotate float64 RotateVelocity float64 CustomImageName string }
func (*Proposal) AddRotateVelocity ¶
func (*Proposal) BoundBottom ¶
func (*Proposal) BoundRight ¶
func (*Proposal) MultiplyVelocity ¶
type ProposalProcessor ¶
type ProposalProcessor interface {
Process(proposal *Proposal)
}
type ProposalProcessorAccelerate ¶
type ProposalProcessorAccelerate struct {
Value float64
}
func (*ProposalProcessorAccelerate) Process ¶
func (p *ProposalProcessorAccelerate) Process(proposal *Proposal)
type ProposalProcessorCustomImageName ¶
type ProposalProcessorCustomImageName struct {
ImageName string
}
func (*ProposalProcessorCustomImageName) Process ¶
func (p *ProposalProcessorCustomImageName) Process(proposal *Proposal)
type ProposalProcessorImprove ¶
type ProposalProcessorImprove struct { }
func (*ProposalProcessorImprove) Process ¶
func (p *ProposalProcessorImprove) Process(proposal *Proposal)
type ProposalProcessorReduceCost ¶
type ProposalProcessorReduceCost struct {
Multiplier float64
}
func (*ProposalProcessorReduceCost) Process ¶
func (p *ProposalProcessorReduceCost) Process(proposal *Proposal)
type ProposalProcessorRotate ¶
type ProposalProcessorRotate struct {
Value float64
}
func (*ProposalProcessorRotate) Process ¶
func (p *ProposalProcessorRotate) Process(proposal *Proposal)
type ProposalProcessorStopRotate ¶
type ProposalProcessorStopRotate struct { }
func (*ProposalProcessorStopRotate) Process ¶
func (p *ProposalProcessorStopRotate) Process(proposal *Proposal)
type VendorSelector ¶
type VendorSelector struct {
// contains filtered or unexported fields
}
func NewVendorSelector ¶
func NewVendorSelector(vendors []*Vendor, interval int, rnd *rand.Rand) *VendorSelector
func (*VendorSelector) IndexOf ¶
func (s *VendorSelector) IndexOf(vendor *Vendor) int
func (*VendorSelector) Reset ¶
func (s *VendorSelector) Reset()
func (*VendorSelector) Update ¶
func (s *VendorSelector) Update() (*Vendor, bool)
func (*VendorSelector) Vendors ¶
func (s *VendorSelector) Vendors() []*Vendor
Click to show internal directories.
Click to hide internal directories.