Package org.oasis_open.docs.wsn._2004._06.wsn_ws_basenotification_1_2_draft_01

Examples of org.oasis_open.docs.wsn._2004._06.wsn_ws_basenotification_1_2_draft_01.TopicExpressionType


            int nodeList[] = {1,8};
            int halfSDtoPlant = 200;
            String manpId = se.createAndRunSeregenttiSubFoodweb(nodeList, "testInsectWeb", 0, 1, true);
                   
           List<ManipulatingNode> nodes = new ArrayList<ManipulatingNode>();
            ManipulatingNode node = new ManipulatingNode();
            node.setTimestepIdx(1);
            node.setManipulationActionType(ManipulationActionType.SPECIES_PROLIFERATION.getManipulationActionType()); // proliferation
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(1);
            node.setBeginingBiomass(2000);
            node.setHasLinks(false);
            nodes.add(node);


            node = new ManipulatingNode();
            node.setTimestepIdx(1);
            node.setManipulationActionType(ManipulationActionType.SPECIES_PROLIFERATION.getManipulationActionType()); // proliferation
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(8);
            node.setBeginingBiomass(2);
            node.setHasLinks(false);
            nodes.add(node);

           
            List<ManipulatingParameter> sParams = new ArrayList<ManipulatingParameter>();
            se.setNodeParameter(1, ManipulatingParameterName.k.getManipulatingParameterIndex(), 8000, sParams);
            se.setLinkParameter(8, 1, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 1, sParams);           

            se.updateSystemParameters(1, false, manpId, sParams, nodes);
          
            nodes = new ArrayList<ManipulatingNode>();
            node = new ManipulatingNode();
            node.setTimestepIdx(2);
            node.setManipulationActionType(ManipulationActionType.SPECIES_INVASION.getManipulationActionType()); // invasion
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(2);
            node.setBeginingBiomass(2000);
            node.setHasLinks(false);
            node.setGameMode(true);           
            node.setOriginFoodwebId(se.getProperties().getProperty("serengetiNetworkId"));           
            nodes.add(node);            
           
            sParams = new ArrayList<ManipulatingParameter>();
            se.setNodeParameter(2, ManipulatingParameterName.k.getManipulatingParameterIndex(), 4000, 2, sParams);                                   
            se.setLinkParameter(8, 2, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 2, sParams);                       
            se.updateSystemParameters(2, false, manpId, sParams, nodes);  

           
           
            nodes = new ArrayList<ManipulatingNode>();
            node = new ManipulatingNode();
            node.setTimestepIdx(3);
            node.setManipulationActionType(ManipulationActionType.SPECIES_INVASION.getManipulationActionType()); // invasion
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(9);
            node.setBeginingBiomass(2);
            node.setHasLinks(false);
            node.setGameMode(true);           
            node.setOriginFoodwebId(se.getProperties().getProperty("serengetiNetworkId"));           
            nodes.add(node);            
           
            sParams = new ArrayList<ManipulatingParameter>();
            se.setLinkParameter(9, 1, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 3, sParams);                       
            se.updateSystemParameters(3, false, manpId, sParams, nodes);              

           
           
           
            nodes = new ArrayList<ManipulatingNode>();
            node = new ManipulatingNode();
            node.setTimestepIdx(4);
            node.setManipulationActionType(ManipulationActionType.SPECIES_INVASION.getManipulationActionType()); // invasion
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(12);
            node.setBeginingBiomass(1.5);
            node.setHasLinks(false);
            node.setGameMode(true);           
            node.setOriginFoodwebId(se.getProperties().getProperty("serengetiNetworkId"));           
            nodes.add(node);            
           
            sParams = new ArrayList<ManipulatingParameter>();
            se.setLinkParameter(12, 1, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 4, sParams);           
            se.updateSystemParameters(4, false, manpId, sParams, nodes);              

           
           
            nodes = new ArrayList<ManipulatingNode>();
            node = new ManipulatingNode();
            node.setTimestepIdx(5);
            node.setManipulationActionType(ManipulationActionType.SPECIES_INVASION.getManipulationActionType()); // invasion
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(5);
            node.setBeginingBiomass(2000);
            node.setHasLinks(false);
            node.setGameMode(true);           
            node.setOriginFoodwebId(se.getProperties().getProperty("serengetiNetworkId"));           
            nodes.add(node);            
           
            sParams = new ArrayList<ManipulatingParameter>();
            se.setNodeParameter(5, ManipulatingParameterName.k.getManipulatingParameterIndex(), 4000, 5, sParams);                                               
            se.setLinkParameter(12, 5, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 5, sParams);                       
            se.updateSystemParameters(5, false, manpId, sParams, nodes);              

           
            nodes = new ArrayList<ManipulatingNode>();
            node = new ManipulatingNode();
            node.setTimestepIdx(6);
            node.setManipulationActionType(ManipulationActionType.SPECIES_INVASION.getManipulationActionType()); // invasion
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(14);
            node.setBeginingBiomass(3);
            node.setHasLinks(false);
            node.setGameMode(true);           
            node.setOriginFoodwebId(se.getProperties().getProperty("serengetiNetworkId"));           
            nodes.add(node);            
           
            sParams = new ArrayList<ManipulatingParameter>();
            se.setLinkParameter(14, 1, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 6, sParams);           
            se.setLinkParameter(14, 2, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 6, sParams);           
            se.setLinkParameter(14, 5, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 6, sParams);                       
            se.updateSystemParameters(6, false, manpId, sParams, nodes);              

           
           
            nodes = new ArrayList<ManipulatingNode>();
            node = new ManipulatingNode();
            node.setTimestepIdx(7);
            node.setManipulationActionType(ManipulationActionType.SPECIES_INVASION.getManipulationActionType()); // invasion
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(7);
            node.setBeginingBiomass(2000);
            node.setHasLinks(false);
            node.setGameMode(true);           
            node.setOriginFoodwebId(se.getProperties().getProperty("serengetiNetworkId"));           
            nodes.add(node);            
           
            sParams = new ArrayList<ManipulatingParameter>();
            se.setNodeParameter(7, ManipulatingParameterName.k.getManipulatingParameterIndex(), 4000, 7, sParams);                                                           
            se.setLinkParameter(14, 7, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 7, sParams);                       
            se.updateSystemParameters(7, false, manpId, sParams, nodes);              

           
            nodes = new ArrayList<ManipulatingNode>();
            node = new ManipulatingNode();
            node.setTimestepIdx(8);
            node.setManipulationActionType(ManipulationActionType.SPECIES_INVASION.getManipulationActionType()); // invasion
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(16);
            node.setBeginingBiomass(1.3);
            node.setHasLinks(false);
            node.setGameMode(true);           
            node.setOriginFoodwebId(se.getProperties().getProperty("serengetiNetworkId"));           
            nodes.add(node);            
           
            sParams = new ArrayList<ManipulatingParameter>();
            se.setLinkParameter(16, 1, ManipulatingParameterName.b0.getManipulatingParameterIndex(), halfSDtoPlant, 8, sParams);                                   
            se.updateSystemParameters(8, false, manpId, sParams, nodes);              

           
            nodes = new ArrayList<ManipulatingNode>();
            node = new ManipulatingNode();
            node.setTimestepIdx(9);
            node.setManipulationActionType(ManipulationActionType.SPECIES_INVASION.getManipulationActionType()); // invasion
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(20);
            node.setBeginingBiomass(1.2);
            node.setHasLinks(false);
            node.setGameMode(true);           
            node.setOriginFoodwebId(se.getProperties().getProperty("serengetiNetworkId"));           
            nodes.add(node);            
           
            sParams = new ArrayList<ManipulatingParameter>();
            se.updateSystemParameters(9, false, manpId, sParams, nodes);              
           
            se.run(10, 20, manpId, false);

           
            nodes = new ArrayList<ManipulatingNode>();
            node = new ManipulatingNode();
            node.setTimestepIdx(30);
            node.setManipulationActionType(ManipulationActionType.SPECIES_PROLIFERATION.getManipulationActionType()); // proliferation
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(1);
            node.setBeginingBiomass(8000);
            node.setHasLinks(false);
            nodes.add(node);
           
            sParams = new ArrayList<ManipulatingParameter>();
            se.updateSystemParameters(30, false, manpId, sParams, nodes);              
           
View Full Code Here


        {
            int nodeList[] = {4,5, 73};
            String manpId = se.createAndRunSeregenttiSubFoodweb(nodeList, "testNode4and73", 0, 1, true);
                   
           List<ManipulatingNode> nodes = new ArrayList<ManipulatingNode>();
            ManipulatingNode node = new ManipulatingNode();
            node.setTimestepIdx(1);
            node.setManipulationActionType(ManipulationActionType.SPECIES_PROLIFERATION.getManipulationActionType()); // proliferation
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(4);
            node.setBeginingBiomass(10000);
            node.setHasLinks(false);
            nodes.add(node);

            node = new ManipulatingNode();
            node.setTimestepIdx(1);
            node.setManipulationActionType(ManipulationActionType.SPECIES_PROLIFERATION.getManipulationActionType()); // proliferation
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(5);
            node.setBeginingBiomass(10000);
            node.setHasLinks(false);
            nodes.add(node);

           
            node = new ManipulatingNode();
            node.setTimestepIdx(1);
            node.setManipulationActionType(ManipulationActionType.SPECIES_PROLIFERATION.getManipulationActionType()); // proliferation
            node.setModelType(ModelType.CASCADE_MODEL.getModelType()); // cascading model
            node.setNodeIdx(73);
            node.setBeginingBiomass(10);
            node.setHasLinks(false);
            nodes.add(node);
           
           
            List<ManipulatingParameter> sParams = new ArrayList<ManipulatingParameter>();
//            this.setNodeParameter(5, ManipulatingParameterName.k.getManipulatingParameterIndex(), 8000, sParams);
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

    }
   
   
    public ManipulatingParameter[] getSystemParameterInfos(String manpId)
    {
        ManipulationParameterInfoRequest request = new ManipulationParameterInfoRequest();
        request.setUser(user);
        request.setManipulationId((manpId));
        request.setMode(SEARCH_MODE);
       

        ManipulationParameterInfoResponse response = new ManipulationParameterInfoResponse();
        try {
//            response = (ManipulationTimestepInfoResponse) svc.executeRequest(req);
View Full Code Here

        request.setUser(user);
        request.setManipulationId((manpId));
        request.setMode(SEARCH_MODE);
       

        ManipulationParameterInfoResponse response = new ManipulationParameterInfoResponse();
        try {
//            response = (ManipulationTimestepInfoResponse) svc.executeRequest(req);
            response = (ManipulationParameterInfoResponse) svc.executeRequest(request);
            //TODO: Write web service call to database
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        String errMsg = response.getMessage();
        if (errMsg != null) {
            System.err.println("Error:" + errMsg);
            return null;
        }
        return response.getManipulationInfos();       
    }
View Full Code Here

    public void getBiomass(String manipulationId, int nodeIndex, int timestep) throws SimulationException {
        long milliseconds = System.currentTimeMillis();
       
        if(timestep >= 0)
        {
            ManipulationTimestepInfoRequest req = new ManipulationTimestepInfoRequest();
            req.setManipulationId(manipulationId);
            req.setIsNodeTimestep(true);
            req.setNodeIdx(nodeIndex);
            req.setTimestep(timestep);

            ManipulationTimestepInfoResponse response = null;
            try {
                response = (ManipulationTimestepInfoResponse) svc.executeRequest(req);
            } catch (RemoteException e) {
View Full Code Here

        int curPage = 1;
        int curTimestep = -1;

        try {
            while (!finished) {
                ManipulationTimestepInfoRequest req = new ManipulationTimestepInfoRequest();
                req.setManipulationId(MANIPULATION_ID);
                req.setIsNodeTimestep(true); // getting node time step
                req.setNodeIdx(0); // set node index to 3
                req.setTimestep(0); // set time step to 5
//                req.setPage(curPage);

                ManipulationTimestepInfoResponse response = (ManipulationTimestepInfoResponse) svc.executeRequest(req);
                ManipulationTimestepInfo[] infos = response.getManipulationTimestepInfos();
View Full Code Here

TOP

Related Classes of org.oasis_open.docs.wsn._2004._06.wsn_ws_basenotification_1_2_draft_01.TopicExpressionType

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.