Example #1
0
File: agent.go Project: elos/tyche
func NewAgent(name string, power int, auction *Auction) *Agent {
	return &Agent{
		Life:         autonomous.NewLife(),
		Stopper:      make(autonomous.Stopper),
		auction:      auction,
		stream:       make(Consumer),
		bettingPower: power,
		identifier:   data.ID(name),
	}
}
Example #2
0
File: db.go Project: elos/gaia
func (db *DB) ParseID(s string) (data.ID, error) {
	oid, err := mongo.ParseObjectID(s)
	return data.ID(oid.Hex()), err
}
Example #3
0
File: db.go Project: elos/gaia
func (db *DB) NewID() data.ID {
	return data.ID(mongo.NewObjectID().Hex())
}