1 // $Id: ui_vars_forces.h,v 1.54 2012/03/09 22:55:20 jmcgill Exp $
2 
3 /*
4  *  Copyright 2004  Peter Beerli, Mary Kuhner, Jon Yamato and Joseph Felsenstein
5  *
6  *  This software is distributed free of charge for non-commercial use
7  *  and is copyrighted.  Of course, we do not guarantee that the software
8  *  works, and are not responsible for any damage you may cause or have.
9  *
10  */
11 
12 // This file contains two classes (one with subclasses) which are derived from UIVarsComponent.
13 // UIVarsSingleForce represents one force; it has a subtype UIVars2DForce for forces whose
14 // parameters form a 2D table (migration, disease, divmigration) and then concrete subclasses
15 // for each type of force.  UIVarsForces is analogous to ForceSummary; it contains stuff about all forces.
16 
17 #ifndef UI_VARS_FORCES_H
18 #define UI_VARS_FORCES_H
19 
20 #include <deque>
21 #include <map>
22 #include <vector>
23 
24 #include "constants.h"          // for method_type
25 #include "defaults.h"           // for force_type
26 #include "ui_strings.h"
27 #include "ui_vars_component.h"
28 #include "ui_vars_prior.h"
29 #include "vectorx.h"
30 #include "stringx.h"
31 #include "paramstat.h"
32 
33 using std::deque;
34 using std::map;
35 using std::vector;
36 
37 class UIVarsForces;
38 
39 // virtual class with common methods across all force types
40 class UIVarsSingleForce : public UIVarsComponent
41 {
42   private:
43     // The number of parameters for this force is also the
44     // number of start values, method types, and profiles
45     //
46     // The correct number of parameters for each force is:
47     //      theta/coal       number of cross partitions
48     //      disease         (number of disease states)  ^2
49     //      migration       (number of populations)     ^2
50     //      growth           number of cross partitions
51     //      rec. rate        1
52     //      gamma over regions "force"  1
53     const long  m_numParameters;
54 
55     const double      m_defaultValue;   // parameter value if none set
56     const method_type m_defaultMethodType;
57 
58   protected: //The gamma force needs to be able to change this.
59     bool              m_canSetOnOff;    // can this force be turned on/off
60 
61   private:
62     bool              m_onOff;          // is this force active?
63     long              m_maxEvents; //maximum number of Events for this force
64     proftype          m_profileType;// profiles of parameters for a single
65     // force must have the same proftype
66 
67     // per-parameter data
68     deque<bool>                     m_doProfile;
69     DoubleVec1d                     m_userSuppliedStartValues;
70     vector<method_type>             m_startValueMethodTypes;
71     vector<ParamGroup>              m_groups;
72     DoubleVec1d                     m_truevalues;
73     vector<ParamStatus>             m_pstatusValues;
74 
75     // Bayesian information
76     UIVarsPrior                     m_defaultPrior;
77     vector<UIVarsPrior>             m_priors;
78     deque<bool>                     m_useDefaultPrior;
79 
80     // Never want to create a UIVarsSingleForce without arguments
81     UIVarsSingleForce();                            // undefined
82     UIVarsSingleForce(const UIVarsSingleForce&);    // undefined
83     UIVarsSingleForce& operator=(const UIVarsSingleForce&); // undefined
84 
85   protected:
86     // member protected (rather than private) because sub-classes
87     // have need to invalidate various parameters
88     const force_type         m_ftype;
89 
90     // wanted this in private area but haven't figured out
91     // the best way to get it there
92     map<method_type,DoubleVec1d>    m_calculatedStartValues;
93 
94     void checkIndexValue(long index) const;
95     virtual void AssertOnIllegalStartMethod(method_type);
96     virtual string GetParamName(long pindex);
97 
98   public:
99     UIVarsSingleForce(
100         UIVars *,
101         force_type ftype,
102         long nparams,
103         double defaultVal,
104         method_type defaultMethod,
105         bool canBeSetUnset,
106         bool isOn,
107         long eventMax,
108         UIVarsPrior defaultPrior);
109     UIVarsSingleForce(UIVars *, const UIVarsSingleForce&);
~UIVarsSingleForce()110     virtual ~UIVarsSingleForce()        {};
111 
112     // pure virtual -- defined by subclasses
GetNumParameters()113     virtual long        GetNumParameters()  const { return m_numParameters;};
GetCanSetOnOff()114     virtual bool        GetCanSetOnOff()    const { return m_canSetOnOff;};
GetOnOff()115     virtual bool        GetOnOff()          const { return m_onOff;};
116     virtual bool        GetLegal()          const;
GetMaxEvents()117     virtual long        GetMaxEvents()      const { return m_maxEvents;};
GetPhase2Type(force_type orig)118     virtual force_type  GetPhase2Type(force_type orig) const { return orig; };
119 
120     // each parameter can have profiling turned ON or OFF (boolean)
121     // but the type of profiling (fixed, percentile) is set at
122     // the per-force level
123     virtual bool            GetDoProfile(long index) const;
124     virtual proftype        GetProfileType()  const;
125     virtual proftype        GetProfileType(long index)  const;
126     virtual string          GetProfileTypeSummaryDescription() const;
127     virtual string          GetPriorTypeSummaryDescription() const;
128     virtual paramlistcondition  GetParamListCondition() const;
129     virtual void            SetDoProfile(bool doIt, long index);
130     virtual void            SetDoProfile(bool doIt);
131     virtual void            SetProfileType(proftype x);
132 
133     virtual ParamStatus     GetParamstatus(long index) const;
134     virtual void   SetParamstatus(const ParamStatus& mystatus, long index);
135 
136     virtual double          GetStartValue(long index)   const;
137     virtual DoubleVec1d     GetStartValues()  const;
138     virtual double          GetMinStartValue(long pindex) const;
139     virtual double          GetMaxStartValue(long pindex) const;
140     virtual void            SetUserStartValue(double startVal, long index);
141     virtual void            SetUserStartValues(double startVal);
142 
143     virtual method_type     GetStartMethod(long index)  const;
144 
145     virtual double          GetTrueValue(long index) const;
146     virtual void            SetTrueValue(double trueval, long index);
147 
148     //Getters and setters for Bayesian information
149     virtual const UIVarsPrior& GetPrior(long pindex) const;
150     virtual priortype GetPriorType(long pindex) const;
151     virtual double GetLowerBound(long pindex)   const;
152     virtual double GetUpperBound(long pindex)   const;
153 #ifdef LAMARC_NEW_FEATURE_RELATIVE_SAMPLING
154     virtual long   GetRelativeSampling(long pindex) const;
155 #endif
156 
157     virtual void SetPriorType(priortype ptype, long pindex);
158     virtual void SetUngroupedPriorType(priortype ptype, long pindex);
159     virtual void SetLowerBound(double bound, long pindex);
160     virtual void SetUngroupedLowerBound(double bound, long pindex);
161     virtual void SetUpperBound(double bound, long pindex);
162     virtual void SetUngroupedUpperBound(double bound, long pindex);
163 #ifdef LAMARC_NEW_FEATURE_RELATIVE_SAMPLING
164     virtual void SetRelativeSampling(long rate, long pindex);
165     virtual void SetUngroupedRelativeSampling(long rate, long pindex);
166 #endif
167 
168     virtual bool GetUseDefaultPrior(long pindex) const;
169     virtual const UIVarsPrior& GetDefaultPrior() const;
170     virtual priortype GetDefaultPriorType() const;
171     virtual double GetDefaultLowerBound()   const;
172     virtual double GetDefaultUpperBound()   const;
173 #ifdef LAMARC_NEW_FEATURE_RELATIVE_SAMPLING
174     virtual long GetDefaultRelativeSampling() const;
175 #endif
176 
177     virtual void SetUseDefaultPrior(bool use, long pindex);
178     virtual void SetUseAllDefaultPriors();
179     virtual void SetDefaultPriorType(priortype ptype);
180     virtual void SetDefaultLowerBound(double bound);
181     virtual void SetDefaultUpperBound(double bound);
182 #ifdef LAMARC_NEW_FEATURE_RELATIVE_SAMPLING
183     virtual void SetDefaultRelativeSampling(long rate);
184 #endif
185 
186     virtual void SetStartMethods(method_type method);
187     // override this method to allow only legal values of method_type
188     virtual void SetStartMethod(method_type method, long index);
189 
190     virtual void        SetMaxEvents(long maxEvents);
191 
192     virtual void        SetOnOff(bool x);
193 
194     virtual bool        GetParamValid(long id) const;
195     virtual bool        GetParamUnique(long id) const;
196 
197     virtual bool        AreZeroesValid() const = 0;
198     virtual bool        SomeVariableParams() const;
199 
200     // Public interface with the groups:
201     virtual void AddGroup(ParamStatus mystatus, LongVec1d indices);
202     virtual void AddParamToGroup(long pindex, long gindex);
203     virtual void AddParamToNewGroup(long pindex);
204     virtual ParamStatus GetGroupParamstatus(long gindex) const;
205     virtual LongVec1d   GetGroupParamList  (long gindex) const;
GetGroups()206     virtual std::vector<ParamGroup> GetGroups() const {return m_groups;};
207     virtual bool AreGroupsValid() const;
208     virtual void FixGroups();
209     virtual void SetGroupParamstatus(ParamStatus pstat, long gindex);
210     virtual long ParamInGroup(long pindex) const;
GetNumGroups()211     virtual long GetNumGroups() const {return m_groups.size();};
212     virtual void RemoveParamIfInAGroup(long pindex);
213 
214   private:
215     //Private interface with the groups:
216     virtual void SetDoProfilesForGroup(bool doIt, long gindex);
217     virtual void checkGIndexValue(long gindex) const;
218 
219     virtual double GetUngroupedStartValue(long index) const;
220 };
221 
222 class UIVars2DForce : public UIVarsSingleForce
223 {
224   private:
225     UIVars2DForce();                                  // undefined
226     UIVars2DForce(const UIVars2DForce&);              // undefined
227     void UpdateReachList(long testRome, std::list<long>& unreached,
228                          std::list<long>& reached) const;
229     long PickANewRome(long oldRome, std::list<long> unreached,
230                       std::list<long> reached) const;
231     bool CanReach(long partfrom, long partto) const;
232     UIVars2DForce& operator=(const UIVars2DForce&); // undefined
233   protected:
234     virtual void AssertOnIllegalStartMethod(method_type);
235     long m_npartitions;
236   public:
237     UIVars2DForce(UIVars *,
238                   force_type ftype,
239                   long npartitions,
240                   double defaultVal,
241                   method_type defaultMethod,
242                   bool canBeSetUnset,
243                   bool isOn,
244                   long eventMax,
245                   UIVarsPrior defaultPrior);
246     UIVars2DForce(UIVars *,const UIVars2DForce&);
~UIVars2DForce()247     virtual ~UIVars2DForce()          {};
248     virtual bool        GetParamValid(long id) const;
249     virtual bool  AreZeroesValid() const;
250 };
251 
252 class UIVarsCoalForce : public UIVarsSingleForce
253 {
254   private:
255     UIVarsCoalForce();                                  // undefined
256     UIVarsCoalForce& operator=(const UIVarsCoalForce&); // undefined
257     UIVarsCoalForce(const UIVarsCoalForce&);            // undefined
258   protected:
259     virtual void AssertOnIllegalStartMethod(method_type);
260   public:
261     UIVarsCoalForce(UIVars *,long numCrossPartitions);
262     UIVarsCoalForce(UIVars *,const UIVarsCoalForce&);
~UIVarsCoalForce()263     virtual ~UIVarsCoalForce()          {};
264     virtual bool        AreZeroesValid() const;
265     void FillCalculatedStartValues();
266 
267 };
268 
269 class UIVarsMigForce : public UIVars2DForce
270 {
271   private:
272     UIVarsMigForce();                                   // undefined
273     UIVarsMigForce& operator=(const UIVarsMigForce&);   // undefined
274     UIVarsMigForce(const UIVarsMigForce&);              // undefined
275   public:
276     UIVarsMigForce(UIVars*, long numPopulations,bool onOrOff);
277     UIVarsMigForce(UIVars*, const UIVarsMigForce&);
~UIVarsMigForce()278     virtual ~UIVarsMigForce()          {};
279     void FillCalculatedStartValues();
280 };
281 
282 class UIVarsDivMigForce : public UIVars2DForce
283 {
284   private:
285     UIVarsDivMigForce();                                   // undefined
286     UIVarsDivMigForce& operator=(const UIVarsMigForce&);   // undefined
287     UIVarsDivMigForce(const UIVarsMigForce&);              // undefined
288   protected:
289     virtual void AssertOnIllegalStartMethod(method_type);
290   public:
291     UIVarsDivMigForce(UIVars*, long numPopulations,bool onOrOff);
292     UIVarsDivMigForce(UIVars*, const UIVarsDivMigForce&);
~UIVarsDivMigForce()293     virtual ~UIVarsDivMigForce()          {};
AreZeroesValid()294     virtual bool  AreZeroesValid() const { return true; }; // zero always valid here
295 };
296 
297 class UIVarsDivergenceForce : public UIVarsSingleForce
298 {
299   private:
300     UIVarsDivergenceForce();                                  // undefined
301     UIVarsDivergenceForce& operator=(const UIVarsDivergenceForce&); // undefined
302     UIVarsDivergenceForce(const UIVarsDivergenceForce&);            // undefined
303     // in the following two vectors, each entry is an epoch
304     std::vector<std::vector<std::string> > newpops;
305     std::vector<std::string> ancestors;
306   protected:
307     virtual void AssertOnIllegalStartMethod(method_type);
308   public:
309     UIVarsDivergenceForce(UIVars *,long numDivPopulations);
310     UIVarsDivergenceForce(UIVars *,const UIVarsDivergenceForce&);
~UIVarsDivergenceForce()311     virtual ~UIVarsDivergenceForce()          {};
312     virtual bool        AreZeroesValid() const;
313     void AddNewPops(const std::vector<std::string>& newp);
314     void AddAncestor(const std::string& anc);
315     std::vector<std::vector<std::string> > GetNewPops() const;
316     std::vector<std::string> GetAncestors() const;
317     std::string GetAncestor(long index) const;
318 
319 };
320 
321 class UIVarsDiseaseForce : public UIVars2DForce
322 {
323   private:
324     long                location;
325     //      string              diseaseName;
326     // LS Note:  If we allow more than one disease/trait at once, and we want
327     //  to model this using one disease force, we'll presumably need a
328     //  vector of strings for the names instead of just the name.  Or we can
329     //  keep doing what we're doing now, which is to use the disease state
330     //  to refer to it ('rate from healthy to diseased', etc.).
331 
332     UIVarsDiseaseForce();                                       // undefined
333     UIVarsDiseaseForce(const UIVarsDiseaseForce&);              // undefined
334     UIVarsDiseaseForce& operator=(const UIVarsDiseaseForce&);   // undefined
335   public:
336     UIVarsDiseaseForce(UIVars*, long numDiseaseStates, bool canTurnOnOff);
337     UIVarsDiseaseForce(UIVars*, const UIVarsDiseaseForce&);
~UIVarsDiseaseForce()338     virtual ~UIVarsDiseaseForce()   {};
339 
GetLocation()340     virtual long        GetLocation()       const {return location;};
341 
SetLocation(long x)342     virtual void    SetLocation(long x)             { location = x; };
343 };
344 
345 class UIVarsRecForce : public UIVarsSingleForce
346 {
347   private:
348     UIVarsRecForce();                                   // undefined
349     UIVarsRecForce(const UIVarsRecForce&);              // undefined
350     UIVarsRecForce& operator=(const UIVarsRecForce&);   // undefined
351   public:
352     UIVarsRecForce(UIVars*, bool canTurnOn);
353     UIVarsRecForce(UIVars*,const UIVarsRecForce&);
~UIVarsRecForce()354     virtual ~UIVarsRecForce()          {};
355     virtual void        SetOnOff(bool onOffVal);
356     virtual bool        GetOnOff()       const;
357     virtual bool        AreZeroesValid() const;
358 };
359 
360 class UIVarsRegionGammaForce : public UIVarsSingleForce
361 {
362   private:
363     UIVarsRegionGammaForce();
364     UIVarsRegionGammaForce(const UIVarsRegionGammaForce&);
365     UIVarsRegionGammaForce& operator=(const UIVarsRegionGammaForce&);
366   public:
367     UIVarsRegionGammaForce(UIVars*);
368     UIVarsRegionGammaForce(UIVars*,const UIVarsRegionGammaForce&);
~UIVarsRegionGammaForce()369     virtual ~UIVarsRegionGammaForce()          {};
370     virtual bool GetOnOff() const;
371     virtual void SetOnOff(bool);
372     virtual bool AreZeroesValid() const;
373 };
374 
375 class UIVarsGrowForce : public UIVarsSingleForce
376 {
377   private:
378     UIVarsGrowForce();                                  // undefined
379     UIVarsGrowForce(const UIVarsGrowForce&);            // undefined
380     UIVarsGrowForce& operator=(const UIVarsGrowForce&); // undefined
381 
382     growth_type    growthType;
383 
384   public:
385     UIVarsGrowForce(UIVars*, long numCrossPartitions);
386     UIVarsGrowForce(UIVars*, const UIVarsGrowForce&);
~UIVarsGrowForce()387     virtual ~UIVarsGrowForce()          {};
388     virtual bool        AreZeroesValid() const;
GetGrowthType()389     virtual growth_type GetGrowthType() const {return growthType;};
SetGrowthType(growth_type g)390     virtual void        SetGrowthType(growth_type g) {growthType=g;};
391     virtual growth_scheme GetGrowthScheme() const;
392     virtual void        SetGrowthScheme(growth_scheme g);
393     virtual force_type  GetPhase2Type(force_type f) const;
394     virtual void        SetOnOff(bool);
395 };
396 
397 class UIVarsLogisticSelectionForce : public UIVarsSingleForce
398 {
399   private:
400     UIVarsLogisticSelectionForce();
401     UIVarsLogisticSelectionForce(const UIVarsLogisticSelectionForce&);
402     UIVarsLogisticSelectionForce& operator=(const UIVarsLogisticSelectionForce&);
403 
404     // double m_observedMajorAlleleFrequency; // ??
405     selection_type selectionType;
406 
407   public:
408     UIVarsLogisticSelectionForce(UIVars*, long numCrossPartitions);
409     UIVarsLogisticSelectionForce(UIVars*, const UIVarsLogisticSelectionForce&);
~UIVarsLogisticSelectionForce()410     virtual ~UIVarsLogisticSelectionForce()          {};
411     virtual bool        AreZeroesValid() const;
GetSelectionType()412     virtual selection_type GetSelectionType() const {return selectionType;};
SetSelectionType(selection_type s)413     virtual void        SetSelectionType(selection_type s) {selectionType=s;};
414     virtual force_type  GetPhase2Type(force_type f) const;
415 };
416 
417 //------------------------------------------------------------------------------------
418 
419 class UIVarsForces : public UIVarsComponent
420 {
421   private:
422     UIVarsForces();                             // undefined
423     UIVarsForces(const UIVarsForces&);         // undefined
424 
425     class IsInactive : public std::unary_function<force_type,bool>
426     {
427       private:
428         const UIVarsForces& m_vars_forces;
429       public:
430         IsInactive(const UIVarsForces&);
431         ~IsInactive();
432         bool operator()(force_type f) const;
433     };
434     class IsIllegal : public std::unary_function<force_type,bool>
435     {
436       private:
437         const UIVarsForces& m_vars_forces;
438       public:
439         IsIllegal(const UIVarsForces&);
440         ~IsIllegal();
441         bool operator()(force_type f) const;
442     };
443 
444     UIVarsCoalForce         coalForce;
445     UIVarsDiseaseForce      diseaseForce;
446     UIVarsGrowForce         growForce;
447     UIVarsMigForce          migForce;
448     UIVarsDivMigForce       divMigForce;
449     UIVarsDivergenceForce   divForce;
450     UIVarsRecForce          recForce;
451     UIVarsRegionGammaForce  regionGammaForce;
452     UIVarsLogisticSelectionForce logisticSelectionForce;
453   protected:
454     const UIVarsSingleForce &     getLegalForce(force_type) const;
455     UIVarsSingleForce &     getLegalForce(force_type);
456     const UIVarsSingleForce &     getForceRegardlessOfLegality(force_type) const;
457   public:
458     // one might argue that the constructors should have
459     // restricted access since only UIVars should
460     // be creating these puppies.
461     UIVarsForces(UIVars *,long nCrossPartitions, long nMigPopulations, long nDivPopulations, long nDiseaseStates, bool canMeasureRecombination);
462     UIVarsForces(UIVars *,const UIVarsForces&);
463     virtual ~UIVarsForces();
464 
465     void FillCalculatedStartValues();
466 
467     // All public non-constructors should be legal to perform
468     // from the menu. If not, put 'em in the protected section
469     LongVec1d             GetForceSizes() const;
470     vector<force_type>    GetActiveForces() const;
471     // the following guarantees a unique tag for any legal Phase 2
472     // force, eg Stick variants of existing forces.  Mary
473     vector<force_type>    GetPhase2ActiveForces() const;
474     vector<force_type>    GetLegalForces() const;
475     vector<force_type>    GetPossibleForces() const;
476     virtual long          GetNumGroups(force_type force) const;
477     virtual long          ParamInGroup(force_type ftype, long pindex) const;
478 
479     bool            GetForceCanTurnOnOff(force_type force) const;
480     bool            GetForceLegal(force_type force) const;
481     bool            GetForceZeroesValidity(force_type force) const;
482     void            FixGroups(force_type force);
483 
484     long            GetDiseaseLocation  () const;
485     bool            GetDoProfile        (force_type force, long id) const;
486     growth_type     GetGrowthType       () const;
487     growth_scheme   GetGrowthScheme     () const;
488     long            GetNumParameters    (force_type force) const;
489     bool            GetParamValid       (force_type force, long id) const;
490     bool            GetParamUnique      (force_type force, long id) const;
491     bool            GetForceOnOff       (force_type force) const;
492     long            GetMaxEvents        (force_type force) const;
493     proftype        GetProfileType      (force_type force) const;
494     proftype        GetProfileType      (force_type force, long id) const;
495     method_type     GetStartMethod      (force_type force, long id) const;
496     ParamStatus     GetParamstatus      (force_type force, long id) const;
497     ParamStatus     GetGroupParamstatus (force_type force, long id) const;
498     LongVec1d       GetGroupParamList   (force_type force, long id) const;
499     // MFIX -- these functions need to be written; only stubs exist!
500     std::vector<ParamGroup> GetIdentGroups   (force_type force) const;
501     std::vector<ParamGroup> GetMultGroups   (force_type force) const;
502     double          GetStartValue       (force_type force, long id) const;
503     DoubleVec1d     GetStartValues      (force_type)  const;
504     double          GetTrueValue        (force_type force, long id) const;
505     force_type      GetPhase2Type       (force_type force) const;
506     selection_type  GetSelectionType    () const;
507 
508     //Getters/setters for Bayesian information
509     virtual bool GetUseDefaultPrior(force_type force, long pindex) const;
510     virtual const UIVarsPrior& GetDefaultPrior (force_type force) const;
511     virtual const UIVarsPrior& GetPrior     (force_type force, long pindex) const;
512     virtual priortype GetPriorType (force_type force, long pindex) const;
513     virtual double    GetLowerBound(force_type force, long pindex) const;
514     virtual double    GetUpperBound(force_type force, long pindex) const;
515 #ifdef LAMARC_NEW_FEATURE_RELATIVE_SAMPLING
516     virtual long      GetRelativeSampling(force_type force, long pindex) const;
517 #endif
518 
519     virtual void SetUseDefaultPrior(bool use,force_type force, long pindex);
520     virtual void SetUseDefaultPriorsForForce(force_type force);
521     virtual void SetPriorType (priortype ptype, force_type force, long pindex);
522     virtual void SetLowerBound(double bound, force_type force, long pindex);
523     virtual void SetUpperBound(double bound, force_type force, long pindex);
524 #ifdef LAMARC_NEW_FEATURE_RELATIVE_SAMPLING
525     virtual void SetRelativeSampling(long rate, force_type force, long pindex);
526 #endif
527     virtual string GetPriorTypeSummaryDescription(force_type force) const;
528     virtual string GetPriorTypeSummaryDescription(force_type force, long pindex, bool sayDefault=true) const;
529 
530     // allows display such as "(some) fixed" for menu summary
531     string  GetProfileTypeSummaryDescription(force_type force) const;
532 
533     void SetForceOnOff  (bool onOff,        force_type forceId);
534     void SetMaxEvents   (long maxEvents,    force_type forceId);
535     //
536     void SetProfileType (proftype ptype);
537     void SetProfileType (proftype ptype,    force_type forceId);
538     //
539     void SetDoProfile   (bool doProfile);
540     void SetDoProfile   (bool doProfile,    force_type forceId);
541     void SetDoProfile   (bool doProfile,    force_type forceId, long id);
542 
543     void SetUserStartValue  (double startValue, force_type forceId, long id);
544     void SetStartMethod (method_type startMethod, force_type forceId, long id);
545     void SetTrueValue  (double startValue, force_type forceId, long id);
546     void SetParamstatus (const ParamStatus& mystatus, force_type force, long id);
547     void SetGroupParamstatus (ParamStatus pstat, force_type force, long id);
548     void AddGroup (LongVec1d params, force_type force, long id);
549     void RemoveParamFromGroup (force_type force, long id);
550     void AddParamToGroup (force_type force, long pindex, long gindex);
551     void AddParamToNewGroup (force_type force, long pindex);
552 
553     void SetAllThetaStartValues             (double startValue);
554     void SetAllThetaStartValuesFST          ();
555     void SetAllThetaStartValuesWatterson    ();
556     void SetThetaStartValue                 (double startValue, long id);
557 
558     void SetAllMigrationStartValues     (double startValue);
559     void SetAllMigrationStartValuesFST  ();
560     void SetMigrationStartValue         (double startValue, long id);
561 
562     void SetDivergenceEpochStartTime  (double startValue, long int id);
563 
564     void SetAllDivMigrationStartValues     (double startValue);
565     // JREMOVE   void SetAllDivMigrationStartValuesFST  ();
566     void SetDivMigrationStartValue         (double startValue, long id);
567 
568     void SetAllDiseaseStartValues   (double startValue);
569     void SetDiseaseStartValue       (double startValue, long id);
570     void SetDiseaseLocation         (long loc);
571 
572     void SetAllGrowthStartValues            (double startValue);
573     void SetGrowthStartValue                (double startValue, long id);
574     void SetGrowthType                      (growth_type gType);
575     void SetGrowthScheme                    (growth_scheme gScheme);
576 
577     void SetRecombinationStartValue         (double startValue);
578 
579     void SetRegionGammaStartValue         (double startValue);
580 
581     void SetLogisticSelectionCoefficientStartValue (double startValue);
582     void SetSelectionType                    (selection_type sType);
583 
584     bool AreZeroesValid(force_type forceId);
585     bool SomeVariableParams() const;
586 
587     // pass-through functions for Divergence force; JNOTE will be removed when this is
588     // handled properly by SetGet machinery
AddNewPops(const std::vector<std::string> & newpops)589     void AddNewPops(const std::vector<std::string>& newpops) {divForce.AddNewPops(newpops); };
AddAncestor(const std::string & ancestor)590     void AddAncestor(const std::string& ancestor) {divForce.AddAncestor(ancestor); };
GetNewPops()591     std::vector<std::vector<std::string> > GetNewPops() const { return divForce.GetNewPops(); };
GetAncestors()592     std::vector<std::string> GetAncestors() const { return divForce.GetAncestors(); };
593 
GetUIVarsRegionGammaForce()594     const UIVarsRegionGammaForce& GetUIVarsRegionGammaForce() const
595     { return regionGammaForce; };
596 
597     std::string GetEpochAncestorName(long id) const;
598     std::string GetEpochDescendentNames(long id) const;
599 
600 };
601 
602 #endif  // UI_VARS_FORCES_H
603 
604 //____________________________________________________________________________________
605