Documentation ¶
Overview ¶
Super simple implementation of a non-concurrent safe LIFO stack for the wanderer.
Index ¶
- Constants
- Variables
- func Atomize(s string) string
- func CcrDetectSubsVertical(startNode *Node, maxN int) (map[string]bool, bool)
- func DetectSubs(startNode *Node, maxN int) (map[*Node]bool, bool)
- func DetectSubsLegacy(startNode *Node, maxN int) (map[string]bool, bool)
- func DetectSubsVertical(startNode *Node, maxN int) (map[*Node]bool, bool)
- func FilingToSaveable(from <-chan Filing) chan Saveable
- func ListenAndSave(c chan Saveable, s Saver)
- func ListenAndSaveFilings(c chan Filing, s *SqlSaver)
- func MinInt(x, y int) (r int)
- type Agent
- type AttrGetter
- type AttrMethodContainer
- type AttrTypeContainer
- type AttrVersionContainer
- type ComObject
- type Counter
- type Dispatcher
- type Edge
- type EdgeKind
- type EdgeToNode
- type Edger
- type Element
- type Filing
- type FilingEdger
- type IndividualName
- type LIFO
- type LLifo
- type Net
- type Network
- func (n *Network) AddDispatcher(dispatcher Dispatcher)
- func (n *Network) AddEdge(edger Edger)
- func (n *Network) AddNode(noder Noder)
- func (n *Network) CheckSubNetwork(subNetwork map[string]bool) bool
- func (n *Network) CheckSubNetworkNodes(subNetwork map[*Node]bool) bool
- func (n *Network) Compare(ns ...Network)
- func (nn *Network) GetAMatrix() (*mat64.Dense, Nlut)
- func (nn *Network) GetDMatrix() (*mat64.Dense, Nlut)
- func (nn *Network) GetLUT() Nlut
- func (nn *Network) GetSortedLUT() Nlut
- func (n *Network) Load()
- func (n *Network) LoadEdges(fp string)
- func (n *Network) LoadFrom(filePath string)
- func (n *Network) LoadNodes(fp string)
- func (nn *Network) PageRankMatrix() map[*Node]float32
- func (nn *Network) PageRankRW(nRW, nSteps int, seeds []*Node) map[*Node]float32
- func (n *Network) PageRankSymmetric() map[*Node]float32
- func (n *Network) PageRankSymmetricRegular() map[*Node]float32
- func (n *Network) Save()
- func (n *Network) SaveAs(fp string)
- func (n *Network) SaveEdges(fp string, ch chan string)
- func (n *Network) SaveNodes(fp string, ch chan string)
- func (n *Network) Search(namePattern string, mode string)
- func (n *Network) SearchEdges(namePattern string) []*Edge
- func (n *Network) SearchNodes(namePattern string) []*Node
- func (n *Network) Summary(w io.Writer)
- type Nlut
- type Node
- type NodeKind
- type Noder
- type OnOffWriter
- type Order
- type RandomWalker
- type SLifo
- type Saveable
- type Saver
- type SimpleEdger
- type SimpleNoder
- type SimpleWanderer
- func (sw *SimpleWanderer) DetectSubs(startNode *Node, maxN int) (map[string]bool, bool)
- func (sw *SimpleWanderer) Merge(sw2 *SimpleWanderer)
- func (sw *SimpleWanderer) Wander(startNode *Node, maxN int) (map[*Node]bool, bool)
- func (sw *SimpleWanderer) WanderStep(startNode *Node, stepSize int, com WandererCom)
- type SqlSaver
- type WandererCom
- type XmlParser
Constants ¶
const TempSuffix = ".tmp"
Variables ¶
var BatchSize int = 10000
Functions ¶
func CcrDetectSubsVertical ¶
func DetectSubs ¶
C. "Stepwise Wide first": potentially slow but no false negatives. Useful because MaxSteps has a meaning.
func DetectSubsLegacy ¶
Old method with string-keyed maps as subnetwork (NEEDS CLEANING!)
func DetectSubsVertical ¶
----------------------- SECTION 4: SUBNETWORK DETECTION A. "Depth-first": this will not allow a detection of a short wide subnetwork when limited in steps. Could be useful for greedy subnetwork search. The most efficient in term of checks.
func FilingToSaveable ¶
func ListenAndSave ¶
func ListenAndSaveFilings ¶
Types ¶
type Agent ¶
type Agent struct { OrganizationName string `xml:",omitempty"` IndividualName IndividualName `xml:"IndividualName,omitempty"` MailAddress string City string State string PostalCode string // County string Country string }
func DeleteAgent ¶
func (*Agent) GetData ¶
func (a *Agent) GetData() AttrGetter
func (*Agent) UpdateData ¶
func (a *Agent) UpdateData(AttrGetter) AttrGetter
type AttrGetter ¶
type AttrGetter interface { }
type AttrMethodContainer ¶
type AttrMethodContainer struct {
Attr string `xml:"Method,attr"`
}
type AttrTypeContainer ¶
type AttrTypeContainer struct {
Attr string `xml:"Type,attr"`
}
type AttrVersionContainer ¶
type AttrVersionContainer struct {
Attr string `xml:"Version,attr"`
}
type ComObject ¶
type ComObject struct {
// contains filtered or unexported fields
}
B. "Depth-first", but concurrent. Should be quite efficient. There is no synchronization mechanism (on purpose), so it is not maxN-reproducible.
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func NewCounter ¶
func NewCounter() *Counter
type EdgeToNode ¶
type Edger ¶
type Edger interface { GetIdentifier() string GetKind() EdgeKind GetData() AttrGetter GetSrcId() string GetDstId() string }
type Filing ¶
type Filing struct { XMLName xml.Name `xml:"FileDetail"` Method AttrMethodContainer `xml:"FilingMethod"` Amendment AttrTypeContainer `xml:"AmendmentType"` FilingType AttrTypeContainer `xml:"TransType"` AltFilingType AttrTypeContainer `xml:"AltFilingType"` OriginalFileNumber int FileNumber int OriginalFileDate string FileDate string Debtors []Agent `xml:"Debtors>DebtorName>Names"` Securers []Agent `xml:"Secured>Names"` }
func (Filing) GetInitStatements ¶
func (Filing) GetSavingStatements ¶
func (*Filing) NewFilingEdger ¶
func (f *Filing) NewFilingEdger(kind EdgeKind, srcId string, dstId string) FilingEdger
type FilingEdger ¶
type FilingEdger struct {
// contains filtered or unexported fields
}
Create a new Edger from a Filing
func (FilingEdger) GetData ¶
func (fe FilingEdger) GetData() AttrGetter
func (FilingEdger) GetDstId ¶
func (fe FilingEdger) GetDstId() string
func (FilingEdger) GetIdentifier ¶
func (fe FilingEdger) GetIdentifier() string
func (FilingEdger) GetKind ¶
func (fe FilingEdger) GetKind() EdgeKind
func (FilingEdger) GetSrcId ¶
func (fe FilingEdger) GetSrcId() string
type IndividualName ¶
type IndividualName struct { FirstName string `xml:",omitempty"` MiddleName string `xml:",omitempty"` LastName string `xml:",omitempty"` }
func (*IndividualName) String ¶
func (i *IndividualName) String() string
type Network ¶
type Network struct { // Objects of the network Name string Edges map[string]*Edge // Remark: see below Nedges int Nodes map[string]*Node // Less efficient with '*' but necessary because we want to share the pointer with the edges and you cannot create apointer to a map element (that can change location) Nnodes int // EdgeNames []string //AL Needed to iterate over all edges quickly... ? // NodeNames []string //AL Needed to iterate over all nodes quickly... ? //LinksData []AttrGetter //AL to be fixed / looked into. // Parameters of the Network Symmetrical bool // TODO let it be assymetrical in the nodes and co. // Meta parameters Folder string Logger *log.Logger PersistingFile string DBDriver string }
func (*Network) AddDispatcher ¶
func (n *Network) AddDispatcher(dispatcher Dispatcher)
func (*Network) CheckSubNetwork ¶
Checking subnetworks
func (*Network) CheckSubNetworkNodes ¶
func (*Network) GetAMatrix ¶
GetAMatrix returns the adjacency matrix of the network.
func (*Network) GetSortedLUT ¶
func (*Network) PageRankMatrix ¶
PageRankMatrix uses matrix computation to efficiently compute the pi ditribution. Can be used only for small networks.
func (*Network) PageRankRW ¶
Pagerank function defined on random walkers (Larry Page way) Applicable in case of large networks if non regular OR for personalization (seeds as a subset)
func (*Network) PageRankSymmetric ¶
Simple PageRank implementation based on node degree information. Applicable only for symetric networks. Everything compiles but the missing property Edge.Weight
func (*Network) PageRankSymmetricRegular ¶
Simple PageRank implementation based on node degree information. Applicable only for regular symetric networks. No Edge strengh is checked. (mainly because the lack of implementation so far)
func (*Network) SearchEdges ¶
func (*Network) SearchNodes ¶
type Nlut ¶
type Nlut struct {
// contains filtered or unexported fields
}
Look up table type for network nodes
type Node ¶
type Node struct { Name string Kind NodeKind Edges []*EdgeToNode //map[string]*Edge NodeData AttrGetter }
type Noder ¶
type Noder interface { GetIdentifier() string GetKind() NodeKind GetData() AttrGetter UpdateData(AttrGetter) AttrGetter }
type OnOffWriter ¶
type OnOffWriter struct { Writing bool // contains filtered or unexported fields }
type RandomWalker ¶
type RandomWalker struct {
// contains filtered or unexported fields
}
func (*RandomWalker) Next ¶
func (rw *RandomWalker) Next() *Node
Advance the walker to the next node
type SimpleEdger ¶
func (*SimpleEdger) GetData ¶
func (s *SimpleEdger) GetData() AttrGetter
func (*SimpleEdger) GetDstId ¶
func (s *SimpleEdger) GetDstId() string
func (*SimpleEdger) GetIdentifier ¶
func (s *SimpleEdger) GetIdentifier() string
func (*SimpleEdger) GetKind ¶
func (s *SimpleEdger) GetKind() EdgeKind
func (*SimpleEdger) GetSrcId ¶
func (s *SimpleEdger) GetSrcId() string
type SimpleNoder ¶
func (*SimpleNoder) GetData ¶
func (s *SimpleNoder) GetData() AttrGetter
func (*SimpleNoder) GetIdentifier ¶
func (s *SimpleNoder) GetIdentifier() string
func (*SimpleNoder) GetKind ¶
func (s *SimpleNoder) GetKind() NodeKind
func (*SimpleNoder) UpdateData ¶
func (s *SimpleNoder) UpdateData(AttrGetter) AttrGetter
type SimpleWanderer ¶
E. "Wanderer", is a non recursive re-writing of the DetectSubVertical to make it concurrent in the bigger picture.
func NewSimpleWanderer ¶
func NewSimpleWanderer() *SimpleWanderer
func (*SimpleWanderer) DetectSubs ¶
func (*SimpleWanderer) Merge ¶
func (sw *SimpleWanderer) Merge(sw2 *SimpleWanderer)
func (*SimpleWanderer) Wander ¶
Wandering function, similar to the DetectSub above, but with embedded duplicity to enable lightweight communication
func (*SimpleWanderer) WanderStep ¶
func (sw *SimpleWanderer) WanderStep(startNode *Node, stepSize int, com WandererCom)
type SqlSaver ¶
type SqlSaver struct {
DbPath, DbName string
DBDriver string
// contains filtered or unexported fields
}
//////// Implement a sql saver
func (*SqlSaver) InitPersistance ¶
func (*SqlSaver) SaveFilingBatch ¶
type WandererCom ¶
type WandererCom struct {
// contains filtered or unexported fields
}
func NewWandererCom ¶
func NewWandererCom() *WandererCom