package forage // SourceRecord remembers a URL that the organism fetched. // Bond ratio indicates how useful the content was. type SourceRecord struct { URL string `json:"url"` BondRatio float64 `json:"bond_ratio"` // fraction of elements that bonded Gen int `json:"gen"` // generation when fetched Hash string `json:"hash"` // SHA-256 of content } // FilterUsefulSources returns sources with bond ratio above threshold. // These are URLs that produced content the lattice could absorb. func FilterUsefulSources(records []SourceRecord, minRatio float64) []SourceRecord { var useful []SourceRecord for _, r := range records { if r.BondRatio >= minRatio { useful = append(useful, r) } } return useful }