func (obj *Split) AppendTransact(transact *Transaction) bool {
	obj.BaseObj.AppendTransact(transact)
	transact.SetHolder(obj.name)
	obj.sumTransact++
	obj.HandleTransact(transact)
	return true
}
AppendTransact append transact to object
package objects
import (
	"fmt"
	utils "github.com/soldatov-s/go-gpss/internal"
)
type HandleSplittingFunc func(obj *Split, transact *Transaction)
type Split struct {
	BaseObj
	Cntsplit        int                  
	Modificator     int                  
	sumSplit        float64              
	sumTransact     float64              
	HandleSplitting HandleSplittingFunc  
}
func Splitting(obj *Split, transact *Transaction) {
	cntsplit := obj.Cntsplit
	if obj.Modificator > 0 {
		cntsplit += utils.GetRandom(-obj.Modificator, obj.Modificator)
	}
	if cntsplit <= 0 {
		cntsplit = 1
	}
	if cntsplit > len(obj.GetDst()) {
		cntsplit = len(obj.GetDst())
	}
	obj.sumSplit += float64(cntsplit)
	if cntsplit == len(obj.GetDst()) {
		for i, v := range obj.GetDst() {
			tr := transact.Copy()
			parentID := tr.GetID()
			tr.SetID(obj.Pipe.NewID())
			tr.SetParts(i+1, cntsplit, parentID)
			v.AppendTransact(tr)  
		}
	} else {
		dsts := make([]bool, cntsplit)
		partID := 1
		for {
			for _, v := range obj.GetDst() {
				if !(utils.GetRandomBool() && !dsts[partID-1]) {
					continue
				}
				tr := transact.Copy()
				parentID := tr.GetID()
				tr.SetID(obj.Pipe.NewID())
				tr.SetParts(partID, cntsplit, parentID)
				v.AppendTransact(tr)
				dsts[partID-1] = true
				partID++
				if partID > cntsplit {
					return
				}
			}
		}
	}
}
func NewSplit(name string, cntsplit, modificator int, hndl HandleSplittingFunc) *Split {
	obj := &Split{}
	obj.name = name
	obj.Cntsplit = cntsplit
	obj.Modificator = modificator
	if hndl != nil {
		obj.HandleSplitting = hndl
	} else {
		obj.HandleSplitting = Splitting
	}
	return obj
}
func (obj *Split) HandleTransact(transact *Transaction) {
	transact.PrintInfo()
	obj.HandleSplitting(obj, transact)
}