Results 1 to 2 of 2
  1. #1
    hish is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default please need help

    hello every body
    i am new with java ide , i am working on my project using eclipse ide . i try to apply ieee14bus contingency case. and doing combination with grid gain, but i could not. i using this java code.
    Java Code:
     package org.interpss.sample.grid.sample;
    
    import org.gridgain.grid.Grid;
    import org.interpss.IpssPlugin;
    import org.interpss.custom.IpssFileAdapter;
    import org.interpss.grid.gridgain.GridRunner;
    import org.interpss.grid.gridgain.job.ContingencyAnaysisReJob;
    import org.interpss.grid.gridgain.util.GridEnvHelper;
    import org.interpss.grid.msg.RemoteMessageTable;
    import org.interpss.grid.result.IRemoteResult;
    import org.interpss.grid.result.RemoteResultFactory;
    import org.interpss.sample.grid.impl.GridHelper;
    import org.interpss.spring.PluginSpringCtx;
    
    import com.interpss.CoreObjectFactory;
    import com.interpss.SimuObjectFactory;
    import com.interpss.common.msg.IPSSMsgHub;
    import com.interpss.common.msg.impl.IPSSMsgHubImpl;
    import com.interpss.core.aclf.AclfNetwork;
    import com.interpss.core.algo.LoadflowAlgorithm;
    import com.interpss.core.net.Branch;
    import com.interpss.simu.SimuContext;
    import com.interpss.simu.SimuCtxType;
    import com.interpss.simu.multicase.ReturnRemoteCaseOpt;
    import com.interpss.simu.multicase.aclf.AclfGridOption;
    import com.interpss.simu.multicase.aclf.AclfStudyCase;
    import com.interpss.simu.multicase.aclf.ContingencyAnalysis;
    import com.interpss.simu.multicase.modify.BranchModification;
    import com.interpss.simu.multicase.modify.Modification;
    
    /**
     * This example assumes that at least one remote Gridgain 1.6.1 agent is running in the LAN. 
     *
     */
    public class IEEE14_ContingencyAnalysis {
    	public static String GridGainHome = "c:/Program Files (x86)/gridgain-1.6.1";
    
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) throws Exception {
    		// InterPSS core simulation engine configuration
    		IpssPlugin.init();
    
        	/*
        	 * step-1 Build the base case
        	 */
    		IpssFileAdapter adapter = PluginSpringCtx.getCustomFileAdapter("ieee");
    		SimuContext simuCtx = adapter.load("testData/ieee14.ieee");
    		AclfNetwork adjNet = simuCtx.getAclfNet();
    		adjNet.setId("IEEE14BusNetId");
        		
    		/*
    		 * step-2 Define LF algorithm
    		 */
    		IPSSMsgHub msg = new IPSSMsgHubImpl();
    	  	LoadflowAlgorithm algo = CoreObjectFactory.createLoadflowAlgorithm(adjNet);
    	  	algo.setNonDivergent(true);
    	  	//algo.setLfMethod(AclfMethod.PQ);
    	  	
    	  	/*
    	  	 * step-3 define multiple study cases
    	  	 */
    		ContingencyAnalysis mCaseContainer = SimuObjectFactory.createContingencyAnalysis(SimuCtxType.ACLF_NETWORK, adjNet);
    		// save the base case Network model
    		mCaseContainer.setBaseNetModelString(adjNet.serialize());
    
    		// persist the Loadflow algorithm to a string
    		String algoStr = algo.serialize();
    		int caseNo = 0;
    		for (Branch branch : adjNet.getBranchList()) {
    			// make sure each studycase has an unique case id
    			AclfStudyCase studyCase = SimuObjectFactory.createAclfStudyCase("caseId"+(++caseNo), 
    					"Turn-off branch "+branch.getId(), 
    					caseNo, mCaseContainer);
    			// persist the LF algo for the study case object
    			studyCase.setAclfAlgoModelString(algoStr);
    
    			// define modification to the base case - turn-off the branch for N-1 analysis
    			BranchModification braMod = SimuObjectFactory.createBranchModification(branch.getId(), adjNet);
    			braMod.setOutService(true);
    			
    			Modification mod = SimuObjectFactory.createModification(braMod);
    			studyCase.setModification(mod);
    		}    		
    		
    		/*
    		 * Step-4 define study options
    		 */
    		mCaseContainer.setRemoteJobCreation(true);
    		AclfGridOption opt = SimuObjectFactory.createAclfGridOption();
    		opt.setReturnCase(ReturnRemoteCaseOpt.ALL_STUDY_CASE);
    		opt.setCalculateViolation(true);
    		opt.setBusVoltageUpperLimitPU(1.1);
    		opt.setBusVoltageLowerLimitPU(0.9);   
    		mCaseContainer.setAclfGridOption(opt);
    		
    		/**
    		 * Step-5 perform grid computing
    		 */
    		// start InterPSS grid env
    		Grid grid = GridHelper.initGridEnv();
    		if (grid != null) {
    			long timeout = 0;
    			RemoteMessageTable[] resultAry = new GridRunner(grid,	"InterPSS Grid Aclf Calculation", 
    					mCaseContainer).executeMultiJobSplitTask(timeout);
    			/**
    			* Step-6 process results
    			*/
    			IRemoteResult resultHandler = RemoteResultFactory.createHandler(ContingencyAnaysisReJob.class);
    			for (RemoteMessageTable result : resultAry) {
    				resultHandler.transferRemoteResult(mCaseContainer, result);
    			}
    			System.out.println(resultHandler.toString(IRemoteResult.DisplayType_SecViolation, mCaseContainer));		
    			System.out.println(resultHandler.toString(IRemoteResult.DisplayType_SecAssessment, mCaseContainer));		
    		}
    		
    		System.out.println("Stop InterPSS Grid env ...");
    		GridEnvHelper.stopDefaultGrid();
    	}
    }
    
    
    
    
    and the error message is
    
    
    log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).
    log4j:WARN Please initialize the log4j system properly.
    Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'odm2AclfMapper' defined in class path resource [org/interpss/spring/ODMMapperSpringCtx.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/ieee/odm/schema/IDRefRecordXmlType
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    	at org.interpss.IpssPlugin.setSpringAppCtx(IpssPlugin.java:73)
    	at org.interpss.IpssPlugin.init(IpssPlugin.java:46)
    	at org.interpss.IpssPlugin.init(IpssPlugin.java:42)
    	at org.interpss.sample.grid.sample.IEEE14_ContingencyAnalysis.main(IEEE14_ContingencyAnalysis.java:43)
    Caused by: java.lang.NoClassDefFoundError: org/ieee/odm/schema/IDRefRecordXmlType
    	at java.lang.Class.getDeclaredConstructors0(Native Method)
    	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    	at java.lang.Class.getConstructor0(Class.java:2699)
    	at java.lang.Class.getDeclaredConstructor(Class.java:1985)
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:54)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
    	... 19 more
    Caused by: java.lang.ClassNotFoundException: org.ieee.odm.schema.IDRefRecordXmlType
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    	... 25 more

    so please how can help me to finish my finial project i will be thankful .
    thanks a lot
    Last edited by sunde887; 11-23-2011 at 12:21 AM. Reason: Added code tags, [code]...[/code]

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: please need help

    Quote Originally Posted by hish View Post
    i try to apply ieee14bus contingency case. and doing combination with grid gain, but i could not. i using this java code.
    Java Code:
    //... large amount of code deleted...
    so please how can help me to finish my finial project i will be thankful .
    How can we help? You haven't asked an answerable question yet?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •