Package org.datacontract.schemas._2004._07.trade

Examples of org.datacontract.schemas._2004._07.trade.BSConfigResponse


        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

        String man_id = se.createAndRunSeregenttiSubFoodweb(nodeList, networkName, 0, 0, true);

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

        lNodeBiomass.add(new NodeBiomass(1000 * 10, 1));
        lNodeBiomass.add(new NodeBiomass(20 * 5, 8));
        lNodeBiomass.add(new NodeBiomass(20 * 5, 9));

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

View Full Code Here

        req.setCreationType(1); // sub food web
        req.setOriginFoodweb(propertiesConfig.getProperty("serengetiNetworkId")); // Serengeti
        req.setNodeList(nodeList);
        req.setOverwrite(overwrite);
       
        CreateFoodwebResponse response = null;
        try {
            response = (CreateFoodwebResponse) svc.executeNetworkCreationRequest(req);
            netId = response.getNetworkId();
            //TODO: Write web service call to database
        } catch (RemoteException e) {
            e.printStackTrace();
        }
       
        String errorMsg = response.getMessage();
        if (errorMsg != null)
        {
            System.err.println("Error type: " + response.getErrorType() + "  error msg:" + errorMsg);
            return null;
        }
       
        return netId;
    }
View Full Code Here

        req.setCreationType(1); // sub food web
        req.setOriginFoodweb(propertiesConfig.getProperty("serengetiNetworkId")); // Serengeti
        int nodeList[] = {Integer.valueOf(propertiesConfig.getProperty("defaultSpecies1Id")), Integer.valueOf(propertiesConfig.getProperty("defaultSpecies2Id"))}; // Grass & buffalo
        req.setNodeList(nodeList);

        CreateFoodwebResponse response = null;
        try {
            response = (CreateFoodwebResponse) svc.executeNetworkCreationRequest(req);
            //TODO: Write web service call to database
        } catch (RemoteException e) {
            e.printStackTrace();
        }
       
        String errorMsg = response.getMessage();
        if (errorMsg != null) {
            System.err.println("Error type: " + response.getErrorType() + "  error msg:" + errorMsg);
            return null;
        } else {
            int timestepIdx = 0;
            List<Integer> lPrey = new ArrayList<Integer>();
            List<Integer> lPredator = new ArrayList<Integer>();
            List<SpeciesZoneType> speciesList = new ArrayList<SpeciesZoneType>();
            SpeciesZoneType szt1 = new SpeciesZoneType(propertiesConfig.getProperty("defaultSpecies1Name"), 5, Integer.valueOf(propertiesConfig.getProperty("defaultSpecies1SpeciesCount")), Double.valueOf(propertiesConfig.getProperty("defaultSpecies1PerSpeciesBiomass")), 0.0, SpeciesTypeEnum.PLANT);
            SpeciesZoneType szt2 = new SpeciesZoneType(propertiesConfig.getProperty("defaultSpecies2Name"), 88, Integer.valueOf(propertiesConfig.getProperty("defaultSpecies2SpeciesCount")), Double.valueOf(propertiesConfig.getProperty("defaultSpecies2PerSpeciesBiomass")), 0.0, SpeciesTypeEnum.ANIMAL);
            speciesList.add(szt1);
            speciesList.add(szt2);           
            //Increasing carrying capacity of grass
            ManipulationResponse mResponse = modifyManipulatingParameters(speciesList, timestepIdx , true, response.getNetworkId());
           
            if(mResponse == null)
                return null;
            String manipulationId = mResponse.getManipulationId();
            String oldNetworkId = mResponse.getNetworksId();
View Full Code Here

    }

    public void getUserManipulations() {
        // list manipulations of user
        try {
            ManipulationInfoRequest req = new ManipulationInfoRequest();
            req.setUser(user);

            ManipulationInfoResponse res = (ManipulationInfoResponse) svc.executeRequest(req);
            //TODO: Write web service call to database
            ManipulationInfo[] infos = res.getManipulationInfos();
            for (int i = 0; i < infos.length; i++) {
View Full Code Here

       
  public void run()
  {
            try
            {
                ManipulationInfoRequest request = new ManipulationInfoRequest();
                request.setUser(user);
                request.setManipulationId(_manpId);
                request.setMode(SimulationEngine.REMOVE_ALL_MODE);
                svc.executeRequest(request);           
            }
            catch(Exception e)
            {
               
View Full Code Here

TOP

Related Classes of org.datacontract.schemas._2004._07.trade.BSConfigResponse

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.