Go Back   Quantrix Forum > Quantrix Support & Discussion > Scripting
FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 02-24-2012, 08:54 AM
Julien Julien is offline
Registered Quantrix.com User
 
Join Date: Mar 2011
Posts: 7
Imported classes sometimes not supported

Hi.

I try to use an established linear programming library, GLPK for JAVA, into a script. After copying the jar files containing the GLPK classes in the ScriptingLibs directory, I faced the following problem: a Quantrix script does not support imported classes with a name beginning with a small letter (org.gnu.glpk.glp_prob for instance). The model and jar files attached to this post illustrate the problem.

I guess this is a feature of the groovy language, and can only be corrected by renaming the classes in the next release of glpk for java. Is it correct?

Best regards,

Julien
Attached Files
File Type: zip testGLPK.zip (51.0 KB, 51 views)
Reply With Quote
  #2  
Old 02-27-2012, 08:35 AM
Ben G Ben G is offline
Quantrix Staff Member
 
Join Date: Dec 2010
Posts: 93
Hi Julien,

See this thread on the Groovy forums:

http://groovy.329449.n5.nabble.com/C...-td356622.html

It looks like you can get around this by creating aliases for the problem class names and applying traditional capitalization to those aliases. For example, if I adjust your "testsmall" function to the following, it runs correctly:

Code:
import testSmall.test_class as Test_class

String testsmall(){
	
	Test_class data = new Test_class()
	
	return "OK"

}
Not exactly elegant, but this appears to be the current workaround, and seems a little easier than renaming library classes at least. Hope it helps.

Regards,
Ben
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Company - Contact - Site Map - Refer A Friend - Support
Solutions - Products - Services - Community - Partners - Webinars - Learning - Store
© Copyright 2007 Subx Inc.-All rights reserved -+1.207.775.0808 -
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.