Exemplo n.º 1
0
func newFetchRatesWorkItem(rCount, frame, limit, hIn int, trainType, symbol string) *fetchRatesWorkItem {
	result := new(fetchRatesWorkItem)
	result.symbol = symbol
	result.Limit = limit
	result.frame = frame
	result.rangeCount = rCount
	result.trainType = trainType
	result.hIn = hIn
	result.mlp = neural.MlpCreate1(frame, frame, hIn)
	result.loopCount = 0
	result.ranges = nil

	return result
}
Exemplo n.º 2
0
// NewWork method
func NewWork(rCount, frame, limit, hIn int, trainType, symbol string) *Work {
	result := new(Work)
	result.symbol = symbol
	result.Limit = limit
	result.frame = frame
	result.rangeCount = rCount
	result.trainType = trainType
	result.hIn = hIn
	result.mlp = neural.MlpCreate1(frame, frame, hIn)
	result.loopCount = 0
	result.ranges = nil
	result.resultRepo = repository.NewResultDataRepo(limit, true, symbol, nil)
	result.effRepo = repository.NewEfficiencyRepo(trainType, symbol, int32(rCount), int32(limit), int32(frame), nil)
	log.Printf("Created new work - Symbol: %s, ResultDataRepo length: %d, EfficiencyRepo length: %d\n", result.symbol, result.resultRepo.Len(), result.effRepo.Len())

	return result
}