| 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 |
package dr.evomodel.alloppnet.operators; |
| 27 |
|
| 28 |
import dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings; |
| 29 |
import dr.evomodel.alloppnet.speciation.AlloppSpeciesNetworkModel; |
| 30 |
import dr.evomodel.alloppnet.parsers.AlloppMoveLegsParser; |
| 31 |
import dr.inference.operators.SimpleMCMCOperator; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
public class AlloppMoveLegs extends SimpleMCMCOperator { |
| 43 |
|
| 44 |
private final AlloppSpeciesNetworkModel apspnet; |
| 45 |
private final AlloppSpeciesBindings apsp; |
| 46 |
|
| 47 |
public AlloppMoveLegs(AlloppSpeciesNetworkModel apspnet, AlloppSpeciesBindings apsp, double weight) { |
| 48 |
this.apspnet = apspnet; |
| 49 |
this.apsp = apsp; |
| 50 |
setWeight(weight); |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
public String getPerformanceSuggestion() { |
| 55 |
return "None"; |
| 56 |
} |
| 57 |
|
| 58 |
@Override |
| 59 |
public String getOperatorName() { |
| 60 |
return AlloppMoveLegsParser.MOVE_LEGS + "(" + apspnet.getId() + |
| 61 |
"," + apsp.getId() + ")"; |
| 62 |
} |
| 63 |
|
| 64 |
@Override |
| 65 |
public double doOperation() { |
| 66 |
apspnet.beginNetworkEdit(); |
| 67 |
apspnet.moveLegs(); |
| 68 |
apspnet.endNetworkEdit(); |
| 69 |
return 0; |
| 70 |
} |
| 71 |
|
| 72 |
} |