meter_gen

package
v4.2.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_ELE = "elec"
	TYPE_GAS = "gas"
	TYPE_MIX = "mix"
)
View Source
const SIZE_POP_RATIO = 121.519 // average france density, used as constant ratio to reduce size of smallest cities

Variables

View Source
var REGEXP_FOLDER = regexp.MustCompile(".*/")

Functions

func FileExists

func FileExists(filePath string) (bool, error)

func GenerateDataLoop

func GenerateDataLoop(params *Params, configClimat *ClimatConfig, configConsum *ConsumConfig, metersTab []Meter, configMeteo []MeteoRecord)

func GetExecutionDir

func GetExecutionDir() string

func GetMeterGenDir

func GetMeterGenDir() string

func IndexOf

func IndexOf(arr []string, test string) int

func InterfaceSliceToFloat64

func InterfaceSliceToFloat64(slice []interface{}) ([]float64, interface{})

func InterfaceSliceToString

func InterfaceSliceToString(slice []interface{}) []string

func JsonToStrMap

func JsonToStrMap(jsonObject []byte) (map[string]string, error)

func JsonToStrSlice

func JsonToStrSlice(jsonObject []byte) ([]string, error)

func Main

func Main(args []string)

func PrintProgress

func PrintProgress(phase string, progress uint64, max uint64)

Types

type City

type City struct {
	// contains filtered or unexported fields
}

type ClimatConfig

type ClimatConfig struct {
	// contains filtered or unexported fields
}

func GetClimatConfig

func GetClimatConfig(climatFilePath string) ClimatConfig

func (*ClimatConfig) GetCoefsFor

func (this *ClimatConfig) GetCoefsFor(country, region, season string) Coefs

type Coefs

type Coefs struct {
	// {"RatioAvg":0.66, "RatioStddev":1.24}
	RatioAvg    float64 `json:"RatioAvg"`
	RatioStddev float64 `json:"RatioStddev"`
}

type ConsumConfValue

type ConsumConfValue struct {
	Avg   int `json:"avg"`
	Stdev int `json:"stddev"`
}

type ConsumConfig

type ConsumConfig struct {
	// {"elec":{"s20":{"coldS":{"wDay":{"Night":{"avg":2996,"stddev":30},...},...},...},...}
	Elec map[string]map[string]map[string]map[string]ConsumConfValue `json:"elec"`
	Gas  map[string]map[string]map[string]map[string]ConsumConfValue `json:"gas"`
}

func GetConsumConfig

func GetConsumConfig(climatFilePath string) ConsumConfig

type MeteoRecord

type MeteoRecord struct {
	//id   string
	Lat  float64   `json:"lat"`
	Lng  float64   `json:"lng"`
	Min  []float64 `json:"min"`
	Max  []float64 `json:"max"`
	Heat []float64 `json:"heat"`
	Cool []float64 `json:"cool"`
}

func GetMeteoConfig

func GetMeteoConfig(meteoFileName string) []MeteoRecord

type Meter

type Meter struct {
	// contains filtered or unexported fields
}

func GenerateMeters

func GenerateMeters(params *Params, configMeteo []MeteoRecord, zones map[string]map[string]string) []Meter

type Params

type Params struct {
	// contains filtered or unexported fields
}

func GetParameters

func GetParameters(args []string) Params

func (*Params) String

func (p *Params) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL