Description Usage Arguments Fields and Methods Author(s) See Also Examples
This is a class implementing the methods which are needed by both the GeneralInsertor and GeneralDeletor process.
Package:
Class GeneralInDel
Object
~~|
~~+--
PSRoot
~~~~~~~|
~~~~~~~+--
Process
~~~~~~~~~~~~|
~~~~~~~~~~~~+--
GeneralInDel
Directly known subclasses:
BrownianInsertor, ContinuousDeletor, ContinuousInsertor, DiscreteDeletor, DiscreteInsertor, FastFieldDeletor, GeneralDeletor, GeneralInsertor
public static class GeneralInDel
extends Process
1 |
name |
The name of the object. |
rate |
The general rate of the object. |
propose.by |
A function used to propose events. |
accept.by |
A function used to accept/reject events. |
... |
Additional arguments. |
Methods:
checkConsistency | - | |
getAcceptBy | - | |
getProposeBy | - | |
getRate | - | |
hasUndefinedRate | - | |
is | - | |
proposeLength | - | |
setAcceptBy | - | |
setProposeBy | - | |
setRate | - | |
summary | - | |
Methods inherited from Process:
!=, ==, as.character, checkConsistency, clone, getAlphabet, getEventsAtSite, getId, getName, getParameterAtSite, getSiteSpecificParamIds, getSiteSpecificParamList, getWriteProtected, hasSiteSpecificParameter, hasUndefinedRate, is, setAlphabet, setId, setName, setParameterAtSite, setSiteSpecificParamIds, setSiteSpecificParamList, setWriteProtected, summary
Methods inherited from PSRoot:
checkConsistency, enableVirtual, getComments, getMethodsList, globalConsistencyCheck, intersect.list, is, is.na, ll, my.all.equal, plot, setComments, setMethodsList, summary, virtualAssignmentForbidden
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save
Botond Sipos, Gregory Jordan
Process GeneralInsertor GeneralDeletor GeneralSubstitution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # create a GeneralInDel object
# rejecting half of the events
# and proposing sizes in the range 1:10
o<-GeneralInDel(
rate=1,
propose.by=function(process){sample(1:10,1)},
accept.by=function(){sample(c(TRUE,FALSE),1)}
);
# check if inherits from GeneralInDel
is.GeneralInDel(o)
# check if it has undefined rates
hasUndefinedRate(o)
# get object summary
summary(o)
# set/get proposeBy function via virtual field
o$proposeBy<-function(process){return(3)} # fixed event length
o$proposeBy
# set/get acceptBy function via virtual field
o$acceptBy<-function(){return(TRUE)} # accept all events
o$acceptBy
# get/set general rate
o$rate
o$rate<-2 # double the rate
# propose event length
proposeLength(o)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.