Package org.datacontract.schemas._2004._07.ManipulationParameter

Examples of org.datacontract.schemas._2004._07.ManipulationParameter.ManipulatingNode


    }       
   
    public String setNodeParameter(int nodeIdx, int paramIdx, double paramValue, List<ManipulatingParameter> sParams )
    {
      System.out.println("SetNodeParameter [nodeIdx]-"+nodeIdx);
        ManipulatingParameter param = new ManipulatingParameter();       
       
        if(paramIdx == ManipulatingParameterName.k.getManipulatingParameterIndex())
        {
            if(paramValue <= 0)
                return "Carrying capacity should be bigger than 0";
            param.setParamType(ManipulatingParameterName.k.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.k.name());
            param.setParamIdx(ManipulatingParameterName.k.getManipulatingParameterIndex());           
            param.setNodeIdx(nodeIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.x.getManipulatingParameterIndex())
        {
            if(paramValue < 0 || paramValue > 1)
                return "Metabolic rate should be between 0 and 1";
            param.setParamType(ManipulatingParameterName.x.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.x.name());
            param.setParamIdx(ManipulatingParameterName.x.getManipulatingParameterIndex());           
            param.setNodeIdx(nodeIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.r.getManipulatingParameterIndex())
        {
            if(paramValue < 0 || paramValue > 1)
                return "Plant growth rate should be between 0 and 1";
            param.setParamType(ManipulatingParameterName.r.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.r.name());
            param.setParamIdx(ManipulatingParameterName.r.getManipulatingParameterIndex());           
            param.setNodeIdx(nodeIdx);
            param.setParamValue(paramValue);           
        }
        else
        {
            return "that type of node parameter is not supported yet";
        }
View Full Code Here


   

//HJR
    public String setFunctionalNodeParameter(int nodeIdx, int preyIdx, int paramIdx, double paramValue, List<ManipulatingParameter> sParams ,SpeciesZoneType szt)
    {
        ManipulatingParameter param = new ManipulatingParameter();       
        List<Integer> predatorIndex = szt.getlPredatorIndex();
        List<Integer> preyIndex = szt.getlPreyIndex();
        if(paramIdx == ManipulatingParameterName.x.getManipulatingParameterIndex())
        {
            if(paramValue <= 0)
                return "Metabolic Rate for Plants should be bigger than 0";
            param.setParamType(ManipulatingParameterName.x.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.x.name());
            param.setParamIdx(ManipulatingParameterName.x.getManipulatingParameterIndex());           
            param.setNodeIdx(nodeIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.ax.getManipulatingParameterIndex())
        {
            if(paramValue <= 0)
                return "Metabolic Rate for Animals should be bigger than 0";
            param.setParamType(ManipulatingParameterName.ax.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.ax.name());
            param.setParamIdx(ManipulatingParameterName.ax.getManipulatingParameterIndex());           
            param.setNodeIdx(nodeIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.e.getManipulatingParameterIndex())
        {
            if(paramValue < 0 || paramValue > 1)
                return "Assimilation Efficiency should be between 0 and 1";
            param.setParamType(ManipulatingParameterName.e.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.e.name());
            param.setParamIdx(ManipulatingParameterName.e.getManipulatingParameterIndex());           
            param.setNodeIdx(nodeIdx);
            param.setPreyIdx(preyIdx);
            param.setPredIdx(nodeIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.d.getManipulatingParameterIndex())
        {
            if(paramValue < 0 || paramValue > 1)
                return "Predator Interference should be between 0 and 1";
            param.setParamType(ManipulatingParameterName.d.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.d.name());
            param.setParamIdx(ManipulatingParameterName.d.getManipulatingParameterIndex());           
            param.setNodeIdx(nodeIdx);
            param.setPreyIdx(preyIdx);
            param.setPredIdx(nodeIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.q.getManipulatingParameterIndex())
        {
            if(paramValue < 0 || paramValue > 1)
                return "Functional Response Control should be between 0 and 1";
            param.setParamType(ManipulatingParameterName.q.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.q.name());
            param.setParamIdx(ManipulatingParameterName.q.getManipulatingParameterIndex());           
            param.setNodeIdx(nodeIdx);
            param.setPreyIdx(preyIdx);
            param.setPredIdx(nodeIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.a.getManipulatingParameterIndex())
        {
            if(paramValue < 0 || paramValue > 1)
                return "Relative Half Saturation Density should be between 0 and 1";
            param.setParamType(ManipulatingParameterName.a.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.a.name());
            param.setParamIdx(ManipulatingParameterName.a.getManipulatingParameterIndex());           
            param.setNodeIdx(nodeIdx);
            param.setPreyIdx(preyIdx);
            param.setPredIdx(nodeIdx);
            param.setParamValue(paramValue);           
        }       
        else
        {
            return "that type of node parameter is not supported yet";
        }
View Full Code Here

       
        return null;
    }
    public String setLinkParameter(int predIdx, int preyIdx, int paramIdx, double paramValue, List<ManipulatingParameter> sParams )
    {
        ManipulatingParameter param = new ManipulatingParameter();       
       
        if(paramIdx == ManipulatingParameterName.e.getManipulatingParameterIndex())
        {
            if(paramValue < 0 || paramValue > 1)
                return "Assimilation efficiency rate should be between 0 and 1";
            param.setParamType(ManipulatingParameterName.e.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.e.name());
            param.setParamIdx(ManipulatingParameterName.e.getManipulatingParameterIndex());           
            param.setPredIdx(predIdx);
            param.setPreyIdx(preyIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.a.getManipulatingParameterIndex())
        {
            if(paramValue < 0 || paramValue > 1)
                return "Relative Half Saturation Density should be between 0 and 1";
            param.setParamType(ManipulatingParameterName.a.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.a.name());
            param.setParamIdx(ManipulatingParameterName.a.getManipulatingParameterIndex());           
            param.setPredIdx(predIdx);
            param.setPreyIdx(preyIdx);
            param.setParamValue(paramValue);           
        }
       else if(paramIdx == ManipulatingParameterName.q.getManipulatingParameterIndex())
        {
            param.setParamType(ManipulatingParameterName.q.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.q.name());
            param.setParamIdx(ManipulatingParameterName.q.getManipulatingParameterIndex());           
            param.setPredIdx(predIdx);
            param.setPreyIdx(preyIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.d.getManipulatingParameterIndex())
        {
            param.setParamType(ManipulatingParameterName.d.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.d.name());
            param.setParamIdx(ManipulatingParameterName.d.getManipulatingParameterIndex());           
            param.setPredIdx(predIdx);
            param.setPreyIdx(preyIdx);
            param.setParamValue(paramValue);           
        }
        else if(paramIdx == ManipulatingParameterName.b0.getManipulatingParameterIndex())
        {
            param.setParamType(ManipulatingParameterName.b0.getManipulatingParameterType());
            param.setParamName(ManipulatingParameterName.b0.name());
            param.setParamIdx(ManipulatingParameterName.b0.getManipulatingParameterIndex());           
            param.setPredIdx(predIdx);
            param.setPreyIdx(preyIdx);
            param.setParamValue(paramValue);           
        }       
       
        else
        {
            return "that type of link parameter is not supported yet";
View Full Code Here

    public String createSeregenttiSubFoodweb(String networkName, int nodeList[], boolean overwrite)
    {
        String netId = null;
       
        ModelParam[] networkParams = new ModelParam[2];
        networkParams[0] = new ModelParam();
        networkParams[0].setParamName(ManipulatingNodePropertyName.Connectance.name());
        networkParams[0].setParamValue(Double.valueOf(propertiesConfig.getProperty("connectanceDefault")));
        networkParams[1] = new ModelParam();
        networkParams[1].setParamName(ManipulatingNodePropertyName.SpeciesCount.name());
        networkParams[1].setParamValue(Integer.valueOf(propertiesConfig.getProperty("speciesCountDefault")));

        NetworkCreationRequest req = new NetworkCreationRequest();
        req.setUser(user); // Owner of network
View Full Code Here

    {
        return propertiesConfig;
    }
    public ManipulationResponse createDefaultSubFoodweb(String networkName) {
        ModelParam[] networkParams = new ModelParam[2];
        networkParams[0] = new ModelParam();
        networkParams[0].setParamName(ManipulatingNodePropertyName.Connectance.name());
        networkParams[0].setParamValue(Double.valueOf(propertiesConfig.getProperty("connectanceDefault")));
        networkParams[1] = new ModelParam();
        networkParams[1].setParamName(ManipulatingNodePropertyName.SpeciesCount.name());
        networkParams[1].setParamValue(Integer.valueOf(propertiesConfig.getProperty("speciesCountDefault")));

        NetworkCreationRequest req = new NetworkCreationRequest();
        req.setUser(user); // Owner of network
View Full Code Here

        smr.setUser(user);
        smr.setBeginingTimestepIdx(timestep);
        smr.setManipulationId(manipulationId);
        smr.setTimestepsToRun(Integer.valueOf(propertiesConfig.getProperty("timestepsToRunDefault")));
        smr.setManipulationModelNodes(nodes);
        NodeBiomass nba[] = (NodeBiomass[]) lNodeBiomass.toArray(new NodeBiomass[0]);
        smr.setNodeBiomasses(nba);
        smr.setDescription(propertiesConfig.getProperty("updateBiomassDescription"));
        smr.setSaveLastTimestepOnly(false);

        ManipulationResponse response = null;
View Full Code Here

        if (!mUpdateSpecies.isEmpty()) {
            List<NodeBiomass> lNodeBiomass = new ArrayList<NodeBiomass>();

            for (SpeciesZoneType s : mUpdateSpecies.values()) {
                System.out.println("Updating Biomass: [" + s.getNodeIndex() + "] " + s.getName() + " " + s.getCurrentBiomass() / Constants.BIOMASS_SCALE);
                lNodeBiomass.add(new NodeBiomass(s.getCurrentBiomass() / Constants.BIOMASS_SCALE, s.getNodeIndex()));
            }

            if (!lNodeBiomass.isEmpty()) {
                try {
                    updateBiomass(networkOrManipulationId, lNodeBiomass, currentTimestep);
View Full Code Here

        List<NodeBiomass> lNodeBiomass = new ArrayList<NodeBiomass>();


        for (SpeciesZoneType s : mSpecies.values()) {
            s.setBiomassUpdate(false);
            lNodeBiomass.add(new NodeBiomass(s.getCurrentBiomass(), s.getNodeIndex()));
        }
       
        if (!lNodeBiomass.isEmpty()) {
            try {
                updateBiomass(networkOrManipulationId, lNodeBiomass, currentTimestep);
View Full Code Here

            int nodeList[] = {5, 7, 33, 52, 80, 82, 86, 92, 95};
            // Fruits and nectar, Grains and seeds, Grass and herbs,  Trees and shrubs, Leopard, Lion, Topi, Buffalo, Southern eland, Nile crocodile
            String manpId = this.createAndRunSeregenttiSubFoodweb(nodeList, "sgModelTest4", 0, 5, true);
           
            List<NodeBiomass> lNodeBiomass = new ArrayList<NodeBiomass>();
            NodeBiomass nb = new NodeBiomass();
            nb.setBiomass(0);
            nb.setNodeIdx(5);
            lNodeBiomass.add(nb);
            nb = new NodeBiomass();
            nb.setBiomass(0);
            nb.setNodeIdx(7);
            lNodeBiomass.add(nb);
            nb = new NodeBiomass();
            nb.setBiomass(0);
            nb.setNodeIdx(33);
            lNodeBiomass.add(nb);
            nb = new NodeBiomass();
            nb.setBiomass(0);
            nb.setNodeIdx(52);
            lNodeBiomass.add(nb);
            nb = new NodeBiomass();
            nb.setBiomass(0);
            nb.setNodeIdx(80);
            lNodeBiomass.add(nb);
            nb = new NodeBiomass();
            nb.setBiomass(0);
            nb.setNodeIdx(82);
            lNodeBiomass.add(nb);
            nb = new NodeBiomass();
            nb.setBiomass(0);
            nb.setNodeIdx(86);
            lNodeBiomass.add(nb);
            nb = new NodeBiomass();
            nb.setBiomass(0);
            nb.setNodeIdx(92);
            lNodeBiomass.add(nb);
            nb = new NodeBiomass();
            nb.setBiomass(0);
            nb.setNodeIdx(95);
            lNodeBiomass.add(nb);

            try {
                this.updateBiomass(manpId,lNodeBiomass, 6);
            } catch (SimulationException ex) {
View Full Code Here

//                        se.setCarryingCapacity(0, 5, zone.getManipulationID(), 3000);

                        List<NodeBiomass> lNodeBiomass = new ArrayList<NodeBiomass>();

                        lNodeBiomass.add(new NodeBiomass(GameServer.getInstance().getSpeciesTypeByNodeID(1).getAvgBiomass() * 10, 1));
                        lNodeBiomass.add(new NodeBiomass(GameServer.getInstance().getSpeciesTypeByNodeID(8).getAvgBiomass() * 5, 8));
                        lNodeBiomass.add(new NodeBiomass(GameServer.getInstance().getSpeciesTypeByNodeID(9).getAvgBiomass() * 5, 9));

                        if (!lNodeBiomass.isEmpty()) {
                            se.updateBiomass(zone.getManipulationID(), lNodeBiomass, 0);
                        }

View Full Code Here

TOP

Related Classes of org.datacontract.schemas._2004._07.ManipulationParameter.ManipulatingNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.