solveppp47.com

ppp47.com  时间:2021-04-07  阅读:()
Package'oppr'May20,2020TypePackageVersion1.
0.
2TitleOptimalProjectPrioritizationDescriptionAdecisionsupporttoolforprioritizingconservationprojects.
Prioritizationscanbedevelopedbymaximizingexpectedfeaturerichness,expectedphylogeneticdiversity,thenumberoffeaturesthatmeetpersistencetargets,oridentifyingasetofprojectsthatmeetpersistencetargetsforminimalcost.
Constraints(e.
g.
lockinspecicactions)andfeatureweightscanalsobespeciedtofurthercustomizeprioritizations.
Afterdeningaprojectprioritizationproblem,solutionscanbeobtainedusingexactalgorithms,heuristicalgorithms,orrandomprocesses.
Inparticular,itisrecommendedtoinstallthe'Gurobi'optimizer(availablefrom)becauseitcanidentifyoptimalsolutionsveryquickly.
Finally,methodsareprovidedforcomparingdifferentprioritizationsandevaluatingtheirbenets.
Formoreinformation,seeHansonetal.
(2019).
Importsutils,methods,stats,Matrix,magrittr(>=1.
5),uuid(>=0.
1.
2),proto(>=1.
0.
0),cli(>=1.
0.
1),assertthat(>=0.
2.
0),tibble(>=2.
0.
0),ape(>=5.
2),tidytree(>=0.
1.
9),ggplot2(>=3.
0.
0),viridisLite(>=0.
3.
0),lpSolveAPI(>=5.
5.
2.
0.
17),Suggeststestthat(>=2.
0.
0),knitr(>=1.
20),roxygen2(>=6.
1.
0),rmarkdown(>=1.
10),gurobi(>=8.
0.
0),ggtree(>=1.
8.
2),Rsymphony(>=0.
1.
28),lpsymphony(>=1.
10.
0),shiny(>=1.
2.
0),rhandsontable(>=0.
3.
7),tidyr(>=0.
8.
2)DependsR(>=3.
4.
0)LinkingToRcpp(>=0.
12.
19),RcppArmadillo(>=0.
9.
100.
5.
0),RcppProgress(>=0.
4.
1)LicenseGPL-3LazyDatatrueSystemRequirementsC++11URLhttps://prioritizr.
github.
io/oppr,https://github.
com/prioritizr/oppr12Rtopicsdocumented:BugReportshttps://github.
com/prioritizr/oppr/issuesVignetteBuilderknitrRoxygenNote7.
1.
0Collate'internal.
R''pproto.
R''Parameter-proto.
R''ArrayParameter-proto.
R''MiscParameter-proto.
R''Parameters-proto.
R''ScalarParameter-proto.
R''parameters.
R''waiver.
R''ProjectModier-proto.
R''Constraint-proto.
R''Collection-proto.
R''Decision-proto.
R''Id.
R''Objective-proto.
R''OptimizationProblem-proto.
R''OptimizationProblem-methods.
R''ProjectProblem-proto.
R''RcppExports.
R''Solver-proto.
R''Target-proto.
R''Weight-proto.
R''action_names.
R''add_absolute_targets.
R''add_binary_decisions.
R''add_default_solver.
R''add_feature_weights.
R''add_gurobi_solver.
R''add_heuristic_solver.
R''add_locked_in_constraints.
R''add_locked_out_constraints.
R''add_lpsolveapi_solver.
R''add_lpsymphony_solver.
R''tbl_df.
R''add_manual_targets.
R''add_manual_locked_constraints.
R''add_max_phylo_div_objective.
R''star_phylogeny.
R''add_max_richness_objective.
R''add_max_targets_met_objective.
R''add_min_set_objective.
R''add_random_solver.
R''add_relative_targets.
R''add_rsymphony_solver.
R''branch_matrix.
R''compile.
R''constraints.
R''data.
R''decisions.
R''feature_names.
R''magrittr-operators.
R''misc.
R''new_optimization_problem.
R''number_of_actions.
R''number_of_features.
R''number_of_projects.
R''objectives.
R''package.
R''solution_statistics.
R''plot.
R''plot_feature_persistence.
R''plot_phylo_persistence.
R''predened_optimization_problem.
R''print.
R''problem.
R''project_cost_effectiveness.
R''project_names.
R''rake_phylogeny.
R''replacement_costs.
R''show.
R''simulate_ppp_data.
R''simulate_ptm_data.
R''solve.
R''solvers.
R''targets.
R''weights.
R''zzz.
R'NeedsCompilationyesAuthorJeffreyOHanson[aut,cre](),RichardSchuster[aut](),MatthewStrimas-Mackey[aut](),JosephRBennett[aut]()MaintainerJeffreyOHansonRepositoryCRANDate/Publication2020-05-2010:10:16UTCRtopicsdocumented:action_names4Rtopicsdocumented:3add_absolute_targets5add_binary_decisions7add_default_solver8add_feature_weights9add_gurobi_solver11add_heuristic_solver14add_locked_in_constraints17add_locked_out_constraints19add_lpsolveapi_solver21add_lsymphony_solver22add_manual_locked_constraints24add_manual_targets26add_max_phylo_div_objective27add_max_richness_objective30add_max_targets_met_objective33add_min_set_objective36add_random_solver38add_relative_targets40add_rsymphony_solver42ArrayParameter-class44array_parameters45as.
Id47as.
list.
OptimizationProblem48branch_matrix49Collection-class50compile51Constraint-class52constraints52Decision-class54decisions54feature_names55is.
Id56matrix_parameters56MiscParameter-class57misc_parameter59new_id60new_optimization_problem61new_waiver61number_of_actions62number_of_features63number_of_projects64Objective-class65objectives65oppr67OptimizationProblem-class69OptimizationProblem-methods71Parameter-class73parameters744action_namesParameters-class75plot.
ProjectProblem76plot_feature_persistence78plot_phylo_persistence80pproto82print83problem84ProjectModier-class88ProjectProblem-class89project_cost_effectiveness93project_names95replacement_costs96ScalarParameter-class97scalar_parameters99show101simulate_ppp_data102simulate_ptm_data105sim_data108solution_statistics110solve111Solver-class113solvers114Target-class116targets116tibble-methods118Weight-class119weights119120%T>121Index122action_namesActionnamesDescriptionExtractthenamesoftheactionsinanobject.
Usageaction_names(x)##S4methodforsignatureProjectProblemaction_names(x)ArgumentsxProjectProblem-class.
add_absolute_targets5Valuecharacteractionnames.
Examples#loaddatadata(sim_projects,sim_features,sim_actions)#buildproblemwithdefaultsolverp%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_default_solver()#printproblemprint(p)#printactionnamesaction_names(p)add_absolute_targetsAddabsolutetargetsDescriptionSettargetsforaprojectprioritizationproblembyspecifyingexactlywhatprobabilityofpersistenceisrequiredforeachfeature.
Forinstance,settinganabsolutetargetof10%(i.
e.
0.
1)correspondstoathreshold10%probabilityofpersisting.
Usageadd_absolute_targets(x,targets)##S4methodforsignatureProjectProblem,numericadd_absolute_targets(x,targets)##S4methodforsignatureProjectProblem,characteradd_absolute_targets(x,targets)ArgumentsxProjectProblem-classobject.
targetsObjectthatspeciesthetargetsforeachfeature.
SeetheDetailssectionformoreinformation.
6add_absolute_targetsDetailsTargetsareusedtospecifytheminimumprobabilityofpersistenceforeachfeatureinsolutions.
Forminimumsetobjectives(i.
e.
add_min_set_objective,thesetargetsspecifytheminimumproba-bilityofpersistencerequiredforeachspeciesinthesolution.
Andforbudgetconstrainedobjectivesthatusetargets(i.
e.
add_max_targets_met_objective),thesetargetsspecifytheminimumthresh-oldprobabilityofpersistencethatneedstobeachievedtocountthebenetsforconservingthesespecies.
Pleasenotethatattemptingtosolveproblemswithobjectivesthatrequiretargetswithoutspecifyingtargetswillthrowanerror.
Thetargetsforaproblemcanbespeciedinseveraldifferentways:numericvectoroftargetvaluesforeachfeature.
Theorderofthetargetvaluesshouldcorrespondtotheorderofthefeaturesinthedatausedtocreatetheargumenttox.
Additionally,forconvenience,thistypeofargumentcanbeasinglevaluetoassignthesametargettoeachfeature.
characterspecifyingthenameofcolumninthefeaturedata(i.
e.
theargumenttofeaturesintheproblemfunction)thatcontainsthepersistencetargets.
SeeAlsotargets.
Examples#loaddatadata(sim_projects,sim_features,sim_actions)#buildproblemwithminimumsetobjectiveandtargetsthatrequireeach#featuretohavea30%chanceofpersistingintothefuturep1%add_min_set_objective()%>%add_absolute_targets(0.
3)%>%add_binary_decisions()#printproblemprint(p1)#buildproblemwithminimumsetobjectiveandspecifytargetsthatrequire#differentlevelsofpersistenceforeachfeaturep2%add_min_set_objective()%>%add_absolute_targets(c(0.
1,0.
2,0.
3,0.
4,0.
5))%>%add_binary_decisions()#printproblemprint(p2)#addacolumnnametothefeaturedatawithtargetssim_features$target%add_min_set_objective()%>%add_absolute_targets("target")%>%add_binary_decisions()#printproblemprint(p3)#solveproblemss1%add_max_richness_objective(budget=200)%>%add_binary_decisions()#printproblemprint(p)#solveproblems%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_default_solver()#printproblemprint(p)#solveproblems%add_max_richness_objective(budget=200)%>%add_binary_decisions()#printproblemadd_gurobi_solver11print(p1)#buildanotherproblem,andspecifyfeatureweightsusingthevaluesinthe#"weight"columnofthesim_featurestablebyspecifyingthecolumn#name"weight"p2%add_feature_weights("weight")#printproblemprint(p2)#buildanotherproblem,andspecifyfeatureweightsusingthe#valuesinthe"weightcolumnofthesim_featurestable,but#actuallyinputthevaluesratherthanspecifyingthecolumnname#"weights"columnofthesim_featurestablep3%add_feature_weights(sim_features$weight)#printproblemprint(p3)#solvetheproblemss1%add_max_richness_objective(budget=200)%>%add_binary_decisions()#buildanotherproblem,andspecifytheGurobisolverp2%add_gurobi_solver()#printproblemprint(p2)#solveproblems2%add_gurobi_solver(number_solutions=100)#printproblemprint(p3)#solveproblems3%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_heuristic_solver()#printproblemprint(p1)#solveproblems1%add_max_richness_objective(budget=150)%>%add_binary_decisions()#printproblemprint(p1)#buildanotherproblem,andlockinthe3rdactionusingnumericinputsp2%add_locked_in_constraints(c(3))#printproblemprint(p2)add_locked_out_constraints19#buildanotherproblem,andlockintheactionsusinglogicalinputsfrom#thesim_actionstablep3%add_locked_in_constraints(sim_actions$locked_in)#printproblemprint(p3)#buildanotherproblem,andlockintheactionsusingthecolumnname#"locked_in"inthesim_actionstable#thesim_actionstablep4%add_locked_in_constraints("locked_in")#printproblemprint(p4)#solveproblemss1%add_max_richness_objective(budget=150)%>%add_binary_decisions()#printproblemprint(p1)#buildanotherproblem,andlockoutthesecondactionusingnumericinputsp2%add_locked_out_constraints(c(2))#printproblemprint(p2)#buildanotherproblem,andlockouttheactionsusinglogicalinputs#(i.
e.
TRUE/FALSEvalues)fromthesim_actionstablep3%add_locked_out_constraints(sim_actions$locked_out)#printproblemprint(p3)#buildanotherproblem,andlockouttheactionsusingthecolumnname#"locked_out"inthesim_actionstable#thesim_actionstablep4%add_locked_out_constraints("locked_out")add_lpsolveapi_solver21#printproblemprint(p4)#solveproblemss1%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_lpsolveapi_solver()#printproblemprint(p)#solveproblems%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_lpsymphony_solver()#printproblemprint(p)#solveproblems%add_max_richness_objective(budget=500)%>%add_manual_locked_constraints(status)%>%add_binary_decisions()#printproblemprint(p)#solveproblems=".
Thiseld(column)isoptionalandifitismissingthentargetsenseswilldefaultto">="values.
"target"numerictargetthreshold.
add_max_phylo_div_objective27ValueProjectProblem-classobjectwiththetargetsaddedtoit.
SeeAlsotargets.
Examples#loaddatadata(sim_projects,sim_features,sim_actions)#createdataframewithtargetstargets%add_min_set_objective()%>%add_manual_targets(targets)%>%add_binary_decisions()#printproblemprint(p)#solveproblems%add_max_phylo_div_objective(budget=300,tree=sim_tree)%>%add_binary_decisions()#solveproblems1%add_feature_weights("weight")#solveproblemwithfeatureweightss2%add_max_richness_objective(budget=200)%>%add_binary_decisions()#solveproblems1%add_feature_weights("weight")#solveproblemwithfeatureweightss2%add_max_targets_met_objective(budget=200)%>%add_absolute_targets(0.
2)%>%add_locked_in_constraints(which(sim_actions$cost%add_binary_decisions()#solveproblems1%add_feature_weights("weight")#solveproblems2%add_min_set_objective()%>%add_absolute_targets(0.
3)%>%add_binary_decisions()#solveproblems%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_random_solver(number_solutions=100)#printproblemprint(p1)#solveproblems1%add_default_solver()%>%40add_relative_targetssolve()#createnewcolumnins1withpercentdifferencefromoptimalitys1$optimality_diff%add_min_set_objective()%>%add_relative_targets(0.
7)%>%add_binary_decisions()#printproblemprint(p1)#buildproblemwithminimumsetobjectiveandspecifytargetsthatrequire#differentlevelsofpersistenceforeachfeaturep2%add_min_set_objective()%>%add_relative_targets(c(0.
2,0.
3,0.
4,0.
5,0.
6))%>%add_binary_decisions()#printproblemprint(p2)#addacolumnnametothefeaturedatawithtargetssim_features$target%add_min_set_objective()%>%add_relative_targets("target")%>%add_binary_decisions()#printproblem42add_rsymphony_solverprint(p3)#solveproblemss1%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_rsymphony_solver()#printproblemprint(p)#solveproblems%add_max_richness_objective(budget=200)%>%add_binary_decisions()#printproblemprint(p)#compileproblemo%add_max_richness_objective(budget=150)%>%add_binary_decisions()#printproblemprint(p1)#buildanotherproblem,andlockinthethirdactionp2%add_locked_in_constraints(c(3))#printproblemprint(p2)#buildanotherproblem,andlockoutthesecondactionp3%add_locked_out_constraints(c(2))#printproblemprint(p3)#solveproblemss1%add_max_richness_objective(budget=200)%>%add_binary_decisions()#printproblemprint(p)feature_names55#solveproblems%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_default_solver()#printproblemprint(p)#printfeaturenamesfeature_names(p)56matrix_parametersis.
IdIsitDescriptionTestifanobjectinheritsfromaclass.
Usageis.
Id(x)is.
Waiver(x)ArgumentsxObject.
Valuelogicalindicatingifitinheritsfromtheclass.
matrix_parametersMatrixparametersDescriptionCreateaparameterthatrepresentsamatrixobject.
Usagenumeric_matrix_parameter(name,value,lower_limit=.
Machine$double.
xmin,upper_limit=.
Machine$double.
xmax,symmetric=FALSE)binary_matrix_parameter(name,value,symmetric=FALSE)MiscParameter-class57Argumentsnamecharacternameofparameter.
valuematrixobject.
lower_limitnumericvaluesdenotingtheminimumacceptablevalueinthematrix.
Defaultstothesmallestpossiblenumberonthesystem.
upper_limitnumericvaluesdenotingthemaximumacceptablevalueinthematrix.
Defaultstothesmallestpossiblenumberonthesystem.
symmetriclogicalmustthemustbematrixbesymmetricDefaultstoFALSE.
ValueMiscParameter-classobject.
Examples#creatematrixm%add_max_richness_objective(budget=200)%>%number_of_features63add_binary_decisions()%>%add_default_solver()#printproblemprint(p)#printnumberofactionsnumber_of_actions(p)number_of_featuresNumberoffeaturesDescriptionExtractthenumberoffeaturesinanobject.
Usagenumber_of_features(x)##S4methodforsignatureProjectProblemnumber_of_features(x)##S4methodforsignatureOptimizationProblemnumber_of_features(x)ArgumentsxProjectProblem-classorOptimizationProblem-classobject.
Valueintegernumberoffeatures.
Examples#loaddatadata(sim_projects,sim_features,sim_actions)#buildproblemwithdefaultsolverp%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_default_solver()#printproblemprint(p)#printnumberoffeaturesnumber_of_features(p)64number_of_projectsnumber_of_projectsNumberofprojectsDescriptionExtractthenumberofprojectsinanobject.
Usagenumber_of_projects(x)##S4methodforsignatureProjectProblemnumber_of_projects(x)##S4methodforsignatureOptimizationProblemnumber_of_projects(x)ArgumentsxProjectProblem-classorOptimizationProblem-classobject.
Valueintegernumberofprojects.
Examples#loaddatadata(sim_projects,sim_features,sim_actions)#buildproblemwithdefaultsolverp%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_default_solver()#printproblemprint(p)#printnumberofprojectsnumber_of_projects(p)Objective-class65Objective-classObjectiveprototypeDescriptionThisprototypeisusedtorepresentanobjectivethatcanbeaddedtoaProjectProblem-classobject.
Thisprototyperepresentsarecipetomakeanobjective,toactuallyaddanobjectivetoaplanningproblem:seeobjectives.
Onlyexpertsshouldusethisclassdirectly.
objectivesProblemobjectiveDescriptionAnobjectiveisusedtospecifytheoverallgoalofaprojectprioritizationproblem.
Allprojectprioritizationproblemsinvolveminimizingormaximizingsomekindofobjective.
Forinstance,thedecisionmakermayrequireafundingschemethatmaximizesthetotalnumberofspeciesthatareexpectedtopersistintothefuturewhilstensuringthatthetotalcostofthefundedactionsdoesnotexceedabudget.
Alternatively,theplannermayrequireasolutionthatensuresthateachspeciesmeetsatargetlevelofpersistencewhilstminimizingthecostofthefundedactions.
Aprojectprioritizationproblemmusthaveaspeciedobjectivebeforeitcanbesolved,andattemptingtosolveaproblemwhichdoesnothaveaspeciedobjectivewillthrowanerror.
DetailsThefollowingobjectivescanbeaddedtoaconservationplanningproblem:add_max_richness_objectiveMaximizethetotalnumberoffeaturesthatareexpectedtopersist,whilstensuringthatthecostofthesolutioniswithinapre-speciedbudget(Joseph,Maloney&Possingham2009).
add_max_targets_met_objectiveMaximizethetotalnumberofpersistencetargetsmetforthefeatures,whilstensuringthatthecostofthesolutioniswithinapre-speciedbudget(Chadesetal.
2015).
add_max_phylo_div_objectiveMaximizethephylogeneticdiversitythatisexpectedtopersistintothefuture,whilstensuringthatthecostofthesolutioniswithinapre-speciedbudget(Bennettetal.
2014,Faith2008).
add_min_set_objectiveMinimizethecostofthesolutionwhilstensuringthatalltargetsaremet.
ThisobjectiveisconceptuallysimilartothatusedinMarxan(Ball,Possingham&Watts2009).
66objectivesReferencesBallIR,PossinghamHP&WattsM(2009)Marxanandrelatives:softwareforspatialconservationprioritisation.
Spatialconservationprioritisation:Quantitativemethodsandcomputationaltools,185-195.
BennettJR,ElliottG,MellishB,JosephLN,TullochAI,ProbertWJ,DiFonzoMMI,MonksJM,PossinghamHP&MaloneyR(2014)Balancingphylogeneticdiversityandspeciesnumbersinconservationprioritization,usingacasestudyofthreatenedspeciesinNewZealand.
BiologicalConservation,174:47–54.
ChadesI,NicolS,vanLeeuwenS,WaltersB,FirnJ,ReesonA,MartinTG&CarwardineJ(2015)Benetsofintegratingcomplementarityintoprioritythreatmanagement.
ConservationBiology,29,525–536.
FaithDP(2008)Threatenedspeciesandthepotentiallossofphylogeneticdiversity:conservationscenariosbasedonestimatedextinctionprobabilitiesandphylogeneticriskanalysis.
ConservationBiology,22:1461–1470.
JosephLN,MaloneyRF&PossinghamHP(2009)Optimalallocationofresourcesamongthreat-enedspecies:Aprojectprioritizationprotocol.
ConservationBiology,23,328–338.
SeeAlsoconstraints,decisions,problem,solvers,targets,weights.
Examples#loaddatadata(sim_projects,sim_features,sim_actions,sim_tree)#buildproblemwithmaximumrichnessobjectiveand$200budgetp1%add_max_richness_objective(budget=200)%>%add_binary_decisions()#solveproblems1%add_max_phylo_div_objective(budget=200,tree=sim_tree)%>%add_binary_decisions()oppr67#solveproblems2%add_max_targets_met_objective(budget=200)%>%add_absolute_targets(0.
4)%>%add_binary_decisions()#solveproblems3%add_min_set_objective()%>%add_absolute_targets(0.
4)%>%add_binary_decisions()#solveproblems4%add_max_richness_objective(budget=400)%>%add_feature_weights("weight")%>%add_binary_decisions()#printproblemOptimizationProblem-class69print(p)#solveproblems%add_max_richness_objective(budget=400)%>%add_feature_weights("weight")%>%add_binary_decisions()#solveproblemwithoutphylogeneticdatas1%add_max_phylo_div_objective(budget=400,sim_tree)%>%add_binary_decisions()#solveproblemwithphylogeneticdatas2%add_max_richness_objective(budget=400)%>%add_feature_weights("weight")%>%add_binary_decisions()%>%add_heuristic_solver(n=10)#solveproblems%add_max_phylo_div_objective(budget=400,sim_tree)%>%add_binary_decisions()%>%add_heuristic_solver(number_solutions=10)#solveproblems%add_max_richness_objective(budget=400)%>%add_feature_weights("weight")%>%add_binary_decisions()#printproblemprint(p)#solveproblems%add_max_richness_objective(budget=400)%>%add_feature_weights("weight")%>%add_binary_decisions()#printproblemprint(p)project_names95#calculatecost-effectivenessofeachprojectpce%add_max_richness_objective(budget=200)%>%add_binary_decisions()%>%add_default_solver()#printproblemprint(p)#printprojectnamesproject_names(p)96replacement_costsreplacement_costsReplacementcostDescriptionCalculatethereplacementcostforpriorityactionsinaprojectprioritizationproblem(Moilanenetal.
2009).
Actionsassociatedwithlargerreplacementcostvaluesaremoreirreplaceabe,andmayneedtobeimplementedsoonerthanactionswithlowerreplacementcostvalues.
Usagereplacement_costs(x,solution,n=1)Argumentsxprojectprioritizationproblem.
solutiondata.
frameortibbletablecontainingthesolutions.
Here,rowscorrespondtodifferentsolutionsandcolumnscorrespondtodifferentactions.
Eachcolumnintheargumenttosolutionshouldbenamedaccordingtoadifferentactioninx.
Cellvaluesindicateifanactionisfundedinagivensolutionornot,andshouldbeeitherzeroorone.
Argumentstosolutioncancontainadditionalcolumns,andtheywillbeignored.
nintegersolutionnumbertocalculatereplacementcostvalues.
Sinceeachrowintheargumenttosolutionscorrespondstoadifferentsolution,thisargumentshouldcorrespondtoarowintheargumenttosolutions.
Defaultsto1.
DetailsReplacementcostvaluesarecalculatedforeachpriorityactionspeciedinthesolution.
Missing(NA)valuesareassignedtoactionswhicharenotselectedforfundinginthespeciedsolution.
Foragivenaction,itsreplacementcostiscalculatedby(i)calculatingtheobjectivevaluefortheoptimalsolutiontotheargumenttox,(ii)calculatingtheobjectivevaluefortheoptimalsolutiontotheargumenttoxwiththegivenactionlockedout,(iii)calculatingthedifferencebetweenthetwoobjectivevalues,(iv)theproblemhasanobjectivewhichaimstominimizetheobjectivevalue(onlyadd_min_set_objective,thentheresultingvalueismultipliedbyminusonesothatlargervaluesalwaysindicateactionswithgreaterirreplaceability.
Pleasenotethisfunctioncantakealongtimetocompleteforlargeproblemssinceitinvolvesre-solvingtheproblemforeveryactionselectedforfunding.
ValueAtibbletablecontainingthefollowingcolumns:"action"characternameofeachaction.
"cost"numericcostofeachsolutionwheneachactionislockedout.
"obj"numericobjectivevalueofeachsolutionwheneachactionislockedout.
Thisiscalculatedusingtheobjectivefunctiondenedfortheargumenttox.
ScalarParameter-class97"rep_cost"numericreplacementcostforeachaction.
Greatervaluesindicategreaterirreplace-ability.
Missing(NA)valuesareassignedtoactionswhicharenotselectedforfundinginthespeciedsolution,innite(Inf)valuesareassignedtotoactionswhicharerequiredtomeetfeasibilityconstraints,andnegativevaluesmeanthatsuperiorsolutionsthanthespeciedso-lutionexist.
ReferencesMoilanenA,ArponenA,StoklandJN&CabezaM(2009)Assessingreplacementcostofconser-vationareas:howdoeshabitatlossinuenceprioritiesBiologicalConservation,142,575–585.
SeeAlsosolution_statistics,project_cost_effectiveness.
Examples#loaddatadata(sim_projects,sim_features,sim_actions)#buildproblemwithmaximumrichnessobjectiveand$400budgetp%add_max_richness_objective(budget=400)%>%add_feature_weights("weight")%>%add_binary_decisions()#solveproblems%add_max_richness_objective(budget=400)%>%add_feature_weights("weight")%>%add_binary_decisions()#printproblemprint(p)#createatablewithsomesolutionssolutions%add_max_richness_objective(budget=400)%>%add_feature_weights("weight")%>%add_binary_decisions()#printproblemprint(p)Solver-class113#solveproblems%add_max_richness_objective(budget=200)%>%add_binary_decisions()#buildanotherproblem,withthedefaultsolverp2%add_default_solver()#buildanotherproblem,withthegurobisolverp3%add_gurobi_solver()#buildanotherproblem,withtheRsymponysolverp4%add_rsymphony_solver()#buildanotherproblem,withthelpsymphonysolverp5%add_lpsymphony_solver()#buildanotherproblem,withthelpSolveAPIsolverp6%add_lpsolveapi_solver()#buildanotherproblem,withtheheuristicsolverp7%116targetsadd_heuristic_solver()#buildanotherproblem,withtherandomsolverp8%add_random_solver()#generatesolutionsusingeachofthesolverss%add_min_set_objective()%>%add_absolute_targets(0.
3)%>%add_binary_decisions()#printproblemprint(p1)#buildproblemwithminimumsetobjectiveandtargetsthatrequireeach#featuretohavealevelofpersistencethatisgreaterthanorequalto#30%ofthebestprojectforconservingitp2%add_min_set_objective()%>%add_relative_targets(0.
3)%>%add_binary_decisions()#printproblemprint(p2)#solveproblemss1%Examples#loaddatadata(sim_projects,sim_features,sim_actions)#buildproblemwithmaximumrichnessobjective,$300budget,and#featureweightsp%add_max_richness_objective(budget=200)%>%add_feature_weights("weight")%>%add_binary_decisions()#solveproblems%PipeoperatorDescriptionThispackageusesthepipeoperator(%>%)toexpressnestedcodeasaseriesofimperativeproce-dures.
Argumentslhs,rhsAnobjectandafunction.
SeeAlso%>%,tee.
Examples#setseedforreproducibilityset.
seed(500)#generate100randomnumbersandcalculatethemeanmean(runif(100))#resettheseedset.
seed(500)%T>%121#repeatthepreviousprocedurebutusethepipeoperatorinsteadofnesting#functioncallsinsideeachother.
runif(100)%>%mean()%T>%TeeoperatorDescriptionThispackageusesthe"tee"operator(%T>%)tomodifyobjects.
Argumentslhs,rhsAnobjectandafunction.
SeeAlso%T>%,pipe.
Examples#theteeoperatorreturnstheleft-handsideoftheresultandcanbe#usefulwhendealingwithmutableobjects.
Inthisexamplewewant#tousethefunction"f"tomodifytheobject"e"andcapturethe#result#createanemptyenvironmente%f()print(e2)#butifweusetheteeoperatorthentheresultcontainsacopyof"e"e3%f()print(e3)IndexTopicdatasetssim_data,108%>%,120,120%T>%,121,121A(OptimizationProblem-methods),71A,OptimizationProblem-method(OptimizationProblem-methods),71action_names,4action_names,ProjectProblem-method(action_names),4add_absolute_targets,5,26,117add_absolute_targets,ProjectProblem,character-method(add_absolute_targets),5add_absolute_targets,ProjectProblem,numeric-method(add_absolute_targets),5add_binary_decisions,7,54add_default_solver,8,114add_feature_weights,9,30,33,119add_feature_weights,ProjectProblem,character-method(add_feature_weights),9add_feature_weights,ProjectProblem,numeric-method(add_feature_weights),9add_gurobi_solver,9,11,14,22,114,115add_heuristic_solver,9,14,115add_locked_in_constraints,17,24,53,85add_locked_in_constraints,ProjectProblem,character-method(add_locked_in_constraints),17add_locked_in_constraints,ProjectProblem,logical-method(add_locked_in_constraints),17add_locked_in_constraints,ProjectProblem,numeric-method(add_locked_in_constraints),17add_locked_out_constraints,19,24,53,85add_locked_out_constraints,ProjectProblem,character-method(add_locked_out_constraints),19add_locked_out_constraints,ProjectProblem,logical-method(add_locked_out_constraints),19add_locked_out_constraints,ProjectProblem,numeric-method(add_locked_out_constraints),19add_lpsolveapi_solver,9,21,114add_lpsymphony_solver,9,114add_lpsymphony_solver(add_lsymphony_solver),22add_lsymphony_solver,22add_manual_locked_constraints,24add_manual_locked_constraints,ProjectProblem,data.
frame-me(add_manual_locked_constraints),24add_manual_locked_constraints,ProjectProblem,tbl_df-method(add_manual_locked_constraints),24add_manual_targets,26,117add_manual_targets,ProjectProblem,data.
frame-method(add_manual_targets),26add_manual_targets,ProjectProblem,tbl_df-method(add_manual_targets),26add_manual_targets-method(add_manual_targets),26add_max_phylo_div_objective,27,65add_max_richness_objective,10,15,30,38,65add_max_targets_met_objective,6,26,33,40,65add_min_set_objective,6,10,15,26,36,38,40,65,96add_random_solver,9,38,115add_relative_targets,26,40,117add_relative_targets,ProjectProblem,character-method(add_relative_targets),40add_relative_targets,ProjectProblem,numeric-method(add_relative_targets),40add_rsymphony_solver,9,14,42,114,115array_parameters,45,75ArrayParameter(ArrayParameter-class),122INDEX12344ArrayParameter-class,44as(as.
Id),47as.
Id,47as.
list,tbl_df-method(tibble-methods),118as.
list.
OptimizationProblem,48binary_matrix_parameter(matrix_parameters),56binary_parameter(scalar_parameters),99binary_parameter_array(array_parameters),45branch_matrix,49col_ids(OptimizationProblem-methods),71col_ids,OptimizationProblem-method(OptimizationProblem-methods),71Collection(Collection-class),50Collection-class,50compile,51,111Constraint(Constraint-class),52Constraint-class,52constraints,18,25,52,52,54,66,84,87,90,115,117,119data.
frame,44,45,76,78,80,85,96,110Decision(Decision-class),54Decision-class,54decisions,8,53,54,54,66,87,115,117,119div,51,76,89feature_names,55feature_names,ProjectProblem-method(feature_names),55get_data(OptimizationProblem-methods),71get_data,OptimizationProblem-method(OptimizationProblem-methods),71ggplot,77,79ggtree,81GurobiSolver-class(Solver-class),113HeuristicSolver-class(Solver-class),113Id,74,76Id(new_id),60integer_parameter(scalar_parameters),99integer_parameter_array(array_parameters),45is(is.
Id),56is.
Id,56lb(OptimizationProblem-methods),71lb,OptimizationProblem-method(OptimizationProblem-methods),71list,48LpsolveapiSolver-class(Solver-class),113LpsymphonySolver-class(Solver-class),113matrix_parameters,56misc_parameter,59MiscParameter(MiscParameter-class),57MiscParameter-class,57modelsense(OptimizationProblem-methods),71modelsense,OptimizationProblem-method(OptimizationProblem-methods),71ncell(OptimizationProblem-methods),71ncell,OptimizationProblem-method(OptimizationProblem-methods),71ncol(OptimizationProblem-methods),71ncol,OptimizationProblem-method(OptimizationProblem-methods),71ncol,tbl_df-method(tibble-methods),118new_id,60new_optimization_problem,61new_waiver,61nrow(OptimizationProblem-methods),71nrow,OptimizationProblem-method(OptimizationProblem-methods),71nrow,tbl_df-method(tibble-methods),118number_of_actions,62124INDEXnumber_of_actions,OptimizationProblem-method(number_of_actions),62number_of_actions,ProjectProblem-method(number_of_actions),62number_of_branches(OptimizationProblem-methods),71number_of_branches,OptimizationProblem-method(OptimizationProblem-methods),71number_of_features,63number_of_features,OptimizationProblem-method(number_of_features),63number_of_features,ProjectProblem-method(number_of_features),63number_of_projects,64number_of_projects,OptimizationProblem-method(number_of_projects),64number_of_projects,ProjectProblem-method(number_of_projects),64numeric_matrix_parameter(matrix_parameters),56numeric_parameter(scalar_parameters),99numeric_parameter_array(array_parameters),45obj(OptimizationProblem-methods),71obj,OptimizationProblem-method(OptimizationProblem-methods),71Objective(Objective-class),65Objective-class,65objectives,29,32,34,37,53,54,65,65,84,86,87,110,115,117,119oppr,67OptimizationProblem(OptimizationProblem-class),69OptimizationProblem-class,69OptimizationProblem-methods,71Parameter(Parameter-class),73Parameter-class,73Parameters(Parameters-class),75parameters,74Parameters-class,75phylo,28,49,92,104,107–109pipe,121pipe(%>%),120plot.
ProjectProblem,76,87plot_feature_persistence,77,78plot_phylo_persistence,77,80pproto,82print,83,84print,Id-method(print),83print,tbl_df-method(print),83print.
ArrayParameter(print),83print.
Id(print),83print.
OptimizationProblem(print),83print.
ProjectModifier(print),83print.
ProjectProblem(print),83print.
ScalarParameter(print),83print.
Solver(print),83problem,5–11,17–19,21,22,24,26,27,30,33,36,38,41,42,51–54,65,66,76,78,80,84,90,93,96,110–112,114,115,117,119project_cost_effectiveness,93,97,110project_names,95project_names,ProjectProblem-method(project_names),95ProjectModifier(ProjectModifier-class),88ProjectModifier-class,88ProjectProblem(ProjectProblem-class),89ProjectProblem-class,89proportion_parameter(scalar_parameters),99proportion_parameter_array(array_parameters),45pwlobj(OptimizationProblem-methods),71pwlobj,OptimizationProblem-method(OptimizationProblem-methods),71RandomSolver-class(Solver-class),113rcoal,103,106replacement_costs,94,96,110rhs(OptimizationProblem-methods),71rhs,OptimizationProblem-method(OptimizationProblem-methods),71row_ids(OptimizationProblem-methods),71row_ids,OptimizationProblem-method(OptimizationProblem-methods),71INDEX125RsymphonySolver-class(Solver-class),113scalar_parameters,75,99ScalarParameter(ScalarParameter-class),97ScalarParameter-class,97sense(OptimizationProblem-methods),71sense,OptimizationProblem-method(OptimizationProblem-methods),71shiny,44,45,58,74,98,99show,101,101show,Id-method(show),101show,OptimizationProblem-method(show),101show,Parameter-method(show),101show,ProjectModifier-method(show),101show,ProjectProblem-method(show),101show,Solver-method(show),101sim_actions(sim_data),108sim_data,108sim_features(sim_data),108sim_projects(sim_data),108sim_tree(sim_data),108simulate_ppp_data,102,107simulate_ptm_data,104,105solution_statistics,87,94,97,110,112solve,51,84,111solve,OptimizationProblem,Solver-method(solve),111solve,ProjectProblem,missing-method(solve),111Solver(Solver-class),113Solver-class,113solvers,9,13,16,22,23,39,43,53,54,66,84,87,112,113,114,117,119Target(Target-class),116Target-class,116targets,6,27,37,41,53,54,66,84,87,115,116,116,119tbl_df,79tee,120tee(%T>%),121tibble,24,26,58,76,78,80,85,92,94,96,103,104,107–110,112,118tibble-methods,118treedata,81ub(OptimizationProblem-methods),71ub,OptimizationProblem-method(OptimizationProblem-methods),71UUIDgenerate,60vtype(OptimizationProblem-methods),71vtype,OptimizationProblem-method(OptimizationProblem-methods),71Weight(Weight-class),119Weight-class,119weights,10,53,54,66,84,87,119,119

pigyun25元/月,香港云服务器仅起;韩国云服务器,美国CUVIP

pigyun怎么样?PIGYun成立于2019年,2021是PIGYun为用户提供稳定服务的第三年,期待我们携手共进、互利共赢。PIGYun为您提供:香港CN2线路、韩国CN2线路、美西CUVIP-9929线路优质IaaS服务。月付另有通用循环优惠码:PIGYun,获取8折循环优惠(永久有效)。目前,PIGYun提供的香港cn2云服务器仅29元/月起;韩国cn2云服务器仅22元/月起;美国CUVI...

.asia域名是否适合做个人网站及.asia域名注册和续费成本

今天看到群里的老秦同学在布局自己的网站项目,这个同学还是比较奇怪的,他就喜欢用这些奇怪的域名。比如前几天看到有用.in域名,个人网站他用的.me域名不奇怪,这个还是常见的。今天看到他在做的一个范文网站的域名,居然用的是 .asia 后缀。问到其理由,是有不错好记的前缀。这里简单的搜索到.ASIA域名的新注册价格是有促销的,大约35元首年左右,续费大约是80元左右,这个成本算的话,比COM域名还贵。...

Digital-VM:服务器,$80/月;挪威/丹麦英国/Digital-VM:日本/新加坡/digital-vm:日本VPS仅$2.4/月

digital-vm怎么样?digital-vm在今年1月份就新增了日本、新加坡独立服务器业务,但是不知为何,期间终止了销售日本服务器和新加坡服务器,今天无意中在webhostingtalk论坛看到Digital-VM在发日本和新加坡独立服务器销售信息。服务器硬件是 Supermicro、采用最新一代 Intel CPU、DDR4 RAM 和 Enterprise Samsung SSD内存,默认...

ppp47.com为你推荐
百度关键词工具百度有关键字分析工具吗?Google AdWords有的336.com求一个游戏的网站 你懂得51sese.com谁有免费看电影的网站?百度指数词什么是百度指数www.mywife.ccmywife哪部最经典www.kknnn.com求有颜色的网站!要免费的4400av.com在www.dadady.com 达达电影看片子很快的啊sesehu.com68lolita com是真的吗www.kaspersky.com.cn卡巴斯基杀毒软件有免费的吗?稳定版的怎么找?www.493333.comwww.xiaonei.com
免费网站域名申请 北京服务器租用 景安vps 什么是二级域名 12306抢票攻略 密码泄露 网站实时监控 java虚拟主机 howfile hostker seednet 域名评估 免费美国空间 台湾谷歌 独享主机 中国电信测速器 阿里云官方网站 云营销系统 浙江服务器 ledlamp 更多