• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trying to reach an object inside other

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, this is my problem
Matbe it's not the best form to explain it, but i'll show the variables first:

I'm working with a Neural Networks library called Joone.
So i need to reach the FileInputSynapse object to easily change the input files.
With a couple of lines of code I can reach the input of my neural network object called nnet, that currently is an InputConnector object;

My problem is that the InputConnector class has no method to get its own inputs, although clearly the FileInputSynapse object it's inside InputConnector

so i'm stuck there, anyone can help please??
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

You would either have to add methods allowing access to that field, or consider that whoever designed the class thought it was a bad idea to allow access to that field at all. Do you have any way to contact whoever designed the class, that you can ask why it is hidden?
 
Alonso Tapia
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to mail the author like 1 month ago for another thing but I never received an answer.
So it looks like I'll have to add methods, but can I do that to a compiled library .jar file??
 
Ranch Hand
Posts: 441
Scala IntelliJ IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, you can't. But a filename wouldn't have been hard-coded into the class, so presumably it's on some properties file somewhere that you can alter.
 
Alonso Tapia
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well I can change the filename very easily the problem is that I can't get to the object that contains that property. That object has another properties too that usually I don't want to change
 
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It really doesn't sound as it should be needed to go this way to change the input files for a library, but you can use reflection and methods like java.lang.reflect.AccessibleObject#setAccessible() to access anything.
 
Luigi Plinge
Ranch Hand
Posts: 441
Scala IntelliJ IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But where does it get those properties from?
 
Alonso Tapia
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok this is the complete deal.
Joone means Java Object Oriented Neural Engine and it's composed by a library and the corresponding GUI. Any NN that I create in the GUI can be exported to a seralized file that can be restored from a custom java program and be manipulated from there so the NN can be used in a real practical application.
This is the NN that I'm currently using, created with the GUI:

The NN is composed by the blocks in the rectangle and the rest are the input-output blocks and connectors to change the input-output when the NN is under Training or Recall.
I really want to keep this structure because it simplifies the Traning & Recall phases necessary for the net to work properly. As you can see File Input has several properties and the only one I'll need to change eventually is InputFile. With I got access to the InputConnector of the left, the direct input to the net, but from that conector to the FileInput object it's what I can't realize how to...
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still think you are not supposed to gain access to that hidden field.
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You wouldn't even know how the system reacts. Maybe it just ignores changes to the filename at runtime because the input nodes have been initialized already?
 
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic