func (m *Mkt) extractFromMsg(mg *sim.Message, qty float64) *sim.Message { extracted := mg.Clone() extracted.Trans.Resource().SetQty(qty) remainder := mg.Trans.Resource().Qty() - qty mg.Trans.Resource().SetQty(remainder) return extracted }
func (f *Fac) Receive(m *sim.Message) { if m.Sender() == f { f.queuedOrders = append(f.queuedOrders, m) } }