Documentation ¶
Overview ¶
generated by ModelGongFileTemplate
Index ¶
- Constants
- Variables
- func CreateORMCountrySpec(countryspec *CountrySpec)
- func CreateORMCountryWithBodies(countrywithbodies *CountryWithBodies)
- func DeleteORMCountrySpec(countryspec *CountrySpec)
- func DeleteORMCountryWithBodies(countrywithbodies *CountryWithBodies)
- func Init(traceHandle io.Writer, infoHandle io.Writer, warningHandle io.Writer, ...)
- type AllModelsStructCreateInterface
- type AllModelsStructDeleteInterface
- type BackRepoInterface
- type BodySetChoice
- type CountrySpec
- func (countryspec *CountrySpec) Checkout() *CountrySpec
- func (countryspec *CountrySpec) Commit() *CountrySpec
- func (countryspec *CountrySpec) DeleteStageAndCommit() *CountrySpec
- func (countryspec *CountrySpec) Stage() *CountrySpec
- func (countryspec *CountrySpec) StageAndCommit() *CountrySpec
- func (countryspec *CountrySpec) StageCopy() *CountrySpec
- func (countryspec *CountrySpec) StageCopyAndCommit() *CountrySpec
- func (countryspec *CountrySpec) Unstage() *CountrySpec
- type CountryWithBodies
- func (countrywithbodies *CountryWithBodies) Checkout() *CountryWithBodies
- func (country *CountryWithBodies) ClosestBodyInOriginalPosition(lat, lng float64) (distance, latClosest, lngClosest, xSpread, ySpread float64, closestIndex int)
- func (countrywithbodies *CountryWithBodies) Commit() *CountryWithBodies
- func (country *CountryWithBodies) ComputeBaryCenters()
- func (countrywithbodies *CountryWithBodies) DeleteStageAndCommit() *CountryWithBodies
- func (country *CountryWithBodies) Init()
- func (country *CountryWithBodies) LatLngToTerritoryBorder(lat, lng float64) PointList
- func (country *CountryWithBodies) LoadConfig(isOriginal bool) bool
- func (countrywithbodies *CountryWithBodies) Stage() *CountryWithBodies
- func (countrywithbodies *CountryWithBodies) StageAndCommit() *CountryWithBodies
- func (countrywithbodies *CountryWithBodies) StageCopy() *CountryWithBodies
- func (countrywithbodies *CountryWithBodies) StageCopyAndCommit() *CountryWithBodies
- func (countrywithbodies *CountryWithBodies) Unstage() *CountryWithBodies
- func (country *CountryWithBodies) XYToLatLng(x, y float64) (lat, lng float64)
- func (country *CountryWithBodies) XYtoTerritoryBodies(x, y float64) PointList
- type OnInitCommitInterface
- type Point
- type PointList
- type StageStruct
- func (stage *StageStruct) Backup(dirPath string)
- func (stage *StageStruct) BackupXL(dirPath string)
- func (stage *StageStruct) Checkout()
- func (stage *StageStruct) Commit()
- func (stage *StageStruct) Nil()
- func (stage *StageStruct) Reset()
- func (stage *StageStruct) Restore(dirPath string)
- func (stage *StageStruct) RestoreXL(dirPath string)
- type Translation
- func (t *Translation) BodyCoordsInSourceCountry(lat, lng float64) (distance, latClosest, lngClosest, xSpread, ySpread float64, closestIndex int)
- func (t *Translation) BodyCoordsInTargetCountry(lat, lng float64) (distance, latClosest, lngClosest, xSpread, ySpread float64, closestIndex int)
- func (t *Translation) GetSourceCountryName() string
- func (t *Translation) GetTargetCountryName() string
- func (t *Translation) LatLngToXYInTargetCountry(x, y float64) (latTarget, lngTarget float64)
- func (t *Translation) SetSourceCountry(name string)
- func (t *Translation) SetTargetCountry(name string)
- func (t *Translation) SourceBorder(lat, lng float64) PointList
- func (t *Translation) TargetBorder(x, y float64) PointList
- type Village
Constants ¶
const ( ORIGINAL_CONFIGURATION = "ORIGINAL_CONFIGURATION" SPREAD_CONFIGURATION = "SPREAD_CONFIGURATION" )
Variables ¶
Functions ¶
func CreateORMCountrySpec ¶
func CreateORMCountrySpec(countryspec *CountrySpec)
CreateORMCountrySpec enables dynamic staging of a CountrySpec instance
func CreateORMCountryWithBodies ¶
func CreateORMCountryWithBodies(countrywithbodies *CountryWithBodies)
CreateORMCountryWithBodies enables dynamic staging of a CountryWithBodies instance
func DeleteORMCountrySpec ¶
func DeleteORMCountrySpec(countryspec *CountrySpec)
DeleteORMCountrySpec enables dynamic staging of a CountrySpec instance
func DeleteORMCountryWithBodies ¶
func DeleteORMCountryWithBodies(countrywithbodies *CountryWithBodies)
DeleteORMCountryWithBodies enables dynamic staging of a CountryWithBodies instance
Types ¶
type AllModelsStructCreateInterface ¶
type AllModelsStructCreateInterface interface { CreateORMCountrySpec(CountrySpec *CountrySpec) CreateORMCountryWithBodies(CountryWithBodies *CountryWithBodies) }
swagger:ignore
type AllModelsStructDeleteInterface ¶
type AllModelsStructDeleteInterface interface { DeleteORMCountrySpec(CountrySpec *CountrySpec) DeleteORMCountryWithBodies(CountryWithBodies *CountryWithBodies) }
type BackRepoInterface ¶
type BackRepoInterface interface { Commit(stage *StageStruct) Checkout(stage *StageStruct) Backup(stage *StageStruct, dirPath string) Restore(stage *StageStruct, dirPath string) BackupXL(stage *StageStruct, dirPath string) RestoreXL(stage *StageStruct, dirPath string) // insertion point for Commit and Checkout signatures CommitCountrySpec(countryspec *CountrySpec) CheckoutCountrySpec(countryspec *CountrySpec) CommitCountryWithBodies(countrywithbodies *CountryWithBodies) CheckoutCountryWithBodies(countrywithbodies *CountryWithBodies) GetLastCommitNb() uint GetLastPushFromFrontNb() uint }
type BodySetChoice ¶
type BodySetChoice string
type CountrySpec ¶
func (*CountrySpec) Checkout ¶
func (countryspec *CountrySpec) Checkout() *CountrySpec
Checkout countryspec to the back repo (if it is already staged)
func (*CountrySpec) Commit ¶
func (countryspec *CountrySpec) Commit() *CountrySpec
commit countryspec to the back repo (if it is already staged)
func (*CountrySpec) DeleteStageAndCommit ¶
func (countryspec *CountrySpec) DeleteStageAndCommit() *CountrySpec
DeleteStageAndCommit appends countryspec to the model stage and commit to the orm repo
func (*CountrySpec) Stage ¶
func (countryspec *CountrySpec) Stage() *CountrySpec
Stage puts countryspec to the model stage
func (*CountrySpec) StageAndCommit ¶
func (countryspec *CountrySpec) StageAndCommit() *CountrySpec
StageAndCommit appends countryspec to the model stage and commit to the orm repo
func (*CountrySpec) StageCopy ¶
func (countryspec *CountrySpec) StageCopy() *CountrySpec
StageCopy appends a copy of countryspec to the model stage
func (*CountrySpec) StageCopyAndCommit ¶
func (countryspec *CountrySpec) StageCopyAndCommit() *CountrySpec
StageCopyAndCommit appends a copy of countryspec to the model stage and commit to the orm repo
func (*CountrySpec) Unstage ¶
func (countryspec *CountrySpec) Unstage() *CountrySpec
Unstage removes countryspec off the model stage
type CountryWithBodies ¶
type CountryWithBodies struct { grump.Country NbBodies int // nb of bodies according to the filename VilCoordinates [][]int Step int // step when the simulation stopped // contains filtered or unexported fields }
func (*CountryWithBodies) Checkout ¶
func (countrywithbodies *CountryWithBodies) Checkout() *CountryWithBodies
Checkout countrywithbodies to the back repo (if it is already staged)
func (*CountryWithBodies) ClosestBodyInOriginalPosition ¶
func (country *CountryWithBodies) ClosestBodyInOriginalPosition(lat, lng float64) ( distance, latClosest, lngClosest, xSpread, ySpread float64, closestIndex int)
given lat, lng, get coords after simulation
func (*CountryWithBodies) Commit ¶
func (countrywithbodies *CountryWithBodies) Commit() *CountryWithBodies
commit countrywithbodies to the back repo (if it is already staged)
func (*CountryWithBodies) ComputeBaryCenters ¶
func (country *CountryWithBodies) ComputeBaryCenters()
compute villages barycenters
func (*CountryWithBodies) DeleteStageAndCommit ¶
func (countrywithbodies *CountryWithBodies) DeleteStageAndCommit() *CountryWithBodies
DeleteStageAndCommit appends countrywithbodies to the model stage and commit to the orm repo
func (*CountryWithBodies) LatLngToTerritoryBorder ¶
func (country *CountryWithBodies) LatLngToTerritoryBorder(lat, lng float64) PointList
given x, y of a point, return the border in the country
func (*CountryWithBodies) LoadConfig ¶
func (country *CountryWithBodies) LoadConfig(isOriginal bool) bool
load configuration from filename into country check that it matches the
func (*CountryWithBodies) Stage ¶
func (countrywithbodies *CountryWithBodies) Stage() *CountryWithBodies
Stage puts countrywithbodies to the model stage
func (*CountryWithBodies) StageAndCommit ¶
func (countrywithbodies *CountryWithBodies) StageAndCommit() *CountryWithBodies
StageAndCommit appends countrywithbodies to the model stage and commit to the orm repo
func (*CountryWithBodies) StageCopy ¶
func (countrywithbodies *CountryWithBodies) StageCopy() *CountryWithBodies
StageCopy appends a copy of countrywithbodies to the model stage
func (*CountryWithBodies) StageCopyAndCommit ¶
func (countrywithbodies *CountryWithBodies) StageCopyAndCommit() *CountryWithBodies
StageCopyAndCommit appends a copy of countrywithbodies to the model stage and commit to the orm repo
func (*CountryWithBodies) Unstage ¶
func (countrywithbodies *CountryWithBodies) Unstage() *CountryWithBodies
Unstage removes countrywithbodies off the model stage
func (*CountryWithBodies) XYToLatLng ¶
func (country *CountryWithBodies) XYToLatLng(x, y float64) (lat, lng float64)
func (*CountryWithBodies) XYtoTerritoryBodies ¶
func (country *CountryWithBodies) XYtoTerritoryBodies(x, y float64) PointList
get the bodies of a village from x, y spread coordinates
type OnInitCommitInterface ¶
type OnInitCommitInterface interface {
BeforeCommit(stage *StageStruct)
}
type StageStruct ¶
type StageStruct struct { CountrySpecs map[*CountrySpec]struct{} CountrySpecs_mapString map[string]*CountrySpec CountryWithBodiess map[*CountryWithBodies]struct{} CountryWithBodiess_mapString map[string]*CountryWithBodies AllModelsStructCreateCallback AllModelsStructCreateInterface AllModelsStructDeleteCallback AllModelsStructDeleteInterface BackRepo BackRepoInterface // if set will be called before each commit to the back repo OnInitCommitCallback OnInitCommitInterface }
StageStruct enables storage of staged instances swagger:ignore
var Stage StageStruct = StageStruct{ CountrySpecs: make(map[*CountrySpec]struct{}), CountrySpecs_mapString: make(map[string]*CountrySpec), CountryWithBodiess: make(map[*CountryWithBodies]struct{}), CountryWithBodiess_mapString: make(map[string]*CountryWithBodies), }
swagger:ignore instructs the gong compiler (gongc) to avoid this particular struct
func (*StageStruct) Backup ¶
func (stage *StageStruct) Backup(dirPath string)
backup generates backup files in the dirPath
func (*StageStruct) BackupXL ¶
func (stage *StageStruct) BackupXL(dirPath string)
backup generates backup files in the dirPath
func (*StageStruct) Checkout ¶
func (stage *StageStruct) Checkout()
func (*StageStruct) Commit ¶
func (stage *StageStruct) Commit()
func (*StageStruct) Nil ¶
func (stage *StageStruct) Nil()
func (*StageStruct) Reset ¶
func (stage *StageStruct) Reset()
func (*StageStruct) Restore ¶
func (stage *StageStruct) Restore(dirPath string)
Restore resets Stage & BackRepo and restores their content from the restore files in dirPath
func (*StageStruct) RestoreXL ¶
func (stage *StageStruct) RestoreXL(dirPath string)
Restore resets Stage & BackRepo and restores their content from the restore files in dirPath
type Translation ¶
type Translation struct {
// contains filtered or unexported fields
}
Definition of a translation between a source and a target country
func GetTranslateCurrent ¶
func GetTranslateCurrent() *Translation
Singloton pattern to init the current translation
func (*Translation) BodyCoordsInSourceCountry ¶
func (t *Translation) BodyCoordsInSourceCountry(lat, lng float64) (distance, latClosest, lngClosest, xSpread, ySpread float64, closestIndex int)
from lat, lng in source country, find the closest body in source country
func (*Translation) BodyCoordsInTargetCountry ¶
func (t *Translation) BodyCoordsInTargetCountry(lat, lng float64) (distance, latClosest, lngClosest, xSpread, ySpread float64, closestIndex int)
from lat, lng in source country, find the closest body in source country
func (*Translation) GetSourceCountryName ¶
func (t *Translation) GetSourceCountryName() string
func (*Translation) GetTargetCountryName ¶
func (t *Translation) GetTargetCountryName() string
func (*Translation) LatLngToXYInTargetCountry ¶
func (t *Translation) LatLngToXYInTargetCountry(x, y float64) (latTarget, lngTarget float64)
from x, y get closest body lat/lng in target country
func (*Translation) SetSourceCountry ¶
func (t *Translation) SetSourceCountry(name string)
func (*Translation) SetTargetCountry ¶
func (t *Translation) SetTargetCountry(name string)
func (*Translation) SourceBorder ¶
func (t *Translation) SourceBorder(lat, lng float64) PointList
func (*Translation) TargetBorder ¶
func (t *Translation) TargetBorder(x, y float64) PointList
from a coordinate in source coutry, get border