• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Intelligent Agents

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am trying to create an intelligent agent using java,
I wrote a code for it and when i compile i am getting error, please help me.

the code i have written is

Please help
Thanks in advance,
Sharon
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In future, while posting code, please UseCodeTags I have added them this time for you. As you case the tags make the code much more easier to read and understand.

sharon christa wrote:I wrote a code for it and when i compile i am getting error, please help me.


What error do you get? Please copy paste the stack trace so we can help you better.
 
sharon christa
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much for your help Maneesh Godbole, since i am new here i dont knw hw to add code tags,
the errors in the code are

CIAgent.java:52: illegal character: \8220
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;
^
CIAgent.java:52: not a statement
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;
^
CIAgent.java:52: ';' expected
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;
^
CIAgent.java:52: illegal character: \8221
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;
^
CIAgent.java:52: illegal character: \8220
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;
^
CIAgent.java:52: not a statement
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;
^
CIAgent.java:52: illegal character: \8221
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;
^
CIAgent.java:52: not a statement
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;
^
CIAgent.java:52: illegal character: \8220
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;

^
CIAgent.java:52: not a statement
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;

^
CIAgent.java:52: illegal character: \8221
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;

^
CIAgent.java:52: ';' expected
System.out.println(ôCIAgent: CIAgentEvent received by ö+name+ô from ö+e.ge
tSource()+ô with args ö+e.getArgObject()) ;

^
CIAgent.java:60: illegal character: \8220
changes.firePropertyChange(ônameö, oldName, name);
^
CIAgent.java:60: illegal character: \8221
changes.firePropertyChange(ônameö, oldName, name);
^
CIAgent.java:60: not a statement
changes.firePropertyChange(ônameö, oldName, name);
^
CIAgent.java:60: not a statement
changes.firePropertyChange(ônameö, oldName, name);
^
CIAgent.java:60: ';' expected
changes.firePropertyChange(ônameö, oldName, name);
^
CIAgent.java:60: not a statement
changes.firePropertyChange(ônameö, oldName, name);
^
CIAgent.java:60: ';' expected
changes.firePropertyChange(ônameö, oldName, name);
^
CIAgent.java:66: illegal character: \8220
public CIAgent() { name = ôCIAgentö; }
^
CIAgent.java:66: illegal character: \8221
public CIAgent() { name = ôCIAgentö; }
^
CIAgent.java:66: not a statement
public CIAgent() { name = ôCIAgentö; }
^
22 errors

Please help me
Regards,
Sharon
 
Maneesh Godbole
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sharon christa wrote:Thank you so much for your help Maneesh Godbole, since i am new here i dont knw hw to add code tags,


This is a link => UseCodeTags <= clicking on it will show you how to UseCodeTags

Coming back to your problem, did you write your code using something like MS Word?
 
sharon christa
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:

sharon christa wrote:Thank you so much for your help Maneesh Godbole, since i am new here i dont knw hw to add code tags,


This is a link => UseCodeTags <= clicking on it will show you how to UseCodeTags

Coming back to your problem, did you write your code using something like MS Word?




I wrote the code in netbeans ide first den again i wrote in notepad, and complied it from command prompt, i dont know why i am getting this error
 
Maneesh Godbole
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Google tells me \8220 is start double quote. Sorry cannot help beyond this, but I think it is an encoding issue. Anyone else?
 
Saloon Keeper
Posts: 6990
164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like the double quotes being used are not "straight" double quotes, but rather the fancy kind used in word processors - which Java does not understand.
 
Marshal
Posts: 73001
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, 8220 = 0x201c which can be written as &201c; which looks like this “ = Double-quote. And ” is &201d;. You need to turn off smart quotes on your word-processor, or get a decent text editor.
 
sharon christa
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys thank you soo much for your help

i corrected it, now an other problem in the code,

the error is cannot find symbol

CIAgent.java:20: cannot find symbol
symbol: class CIAgentEventListener
public class CIAgent implements CIAgentEventListener, Runnable {
^
CIAgent.java:26: cannot find symbol
symbol : class CIAgentEventListener
location: class agents.CIAgent
addCIAgentEventListener(CIAgentEventListener ciaEventListener) {
^
CIAgent.java:31: cannot find symbol
symbol : class CIAgentEventListener
location: class agents.CIAgent
removeCIAgentEventListener(CIAgentEventListener ciaEventListener)
^
CIAgent.java:47: cannot find symbol
symbol : class CIAgentEvent
location: class agents.CIAgent
protected void notifyCIAgentEventListeners(CIAgentEvent e) {
^
CIAgent.java:55: cannot find symbol
symbol : class CIAgentEvent
location: class agents.CIAgent
public void ciaEventFired(CIAgentEvent e) {
^
CIAgent.java:67: cannot find symbol
symbol : class PropertyChangeSupport
location: class agents.CIAgent
private PropertyChangeSupport changes =
^
CIAgent.java:77: cannot find symbol
symbol : class TextArea
location: class agents.CIAgent
TextArea textArea ;
^
CIAgent.java:38: cannot find symbol
symbol : class CIAgentEvent
location: class agents.CIAgent
CIAgentEvent e = new CIAgentEvent(this) ;
^
CIAgent.java:38: cannot find symbol
symbol : class CIAgentEvent
location: class agents.CIAgent
CIAgentEvent e = new CIAgentEvent(this) ;
^
CIAgent.java:42: cannot find symbol
symbol : class CIAgentEventListener
location: class agents.CIAgent
((CIAgentEventListener)l.elementAt(i)).ciaEventFired(e);
^
CIAgent.java:51: cannot find symbol
symbol : class CIAgentEventListener
location: class agents.CIAgent
((CIAgentEventListener)l.elementAt(i)).ciaEventFired(e);
^
CIAgent.java:68: cannot find symbol
symbol : class PropertyChangeSupport
location: class agents.CIAgent
new PropertyChangeSupport(this);
^
CIAgent.java:85: cannot find symbol
symbol : class Marketplace
location: class agents.CIAgent
if (market != null) ((Marketplace)market).trace(msg) ;
^
13 errors

so i added classes like

import java.io.*;
import java.util.*;
import java.lang.Object;
import java.lang.Thread;

still its not working
I am sure you guys can help.
 
Tim Moores
Saloon Keeper
Posts: 6990
164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's missing classes CIAgentEventListener, Marketplace and PropertyChangeSupport - those are not in any of the packages you import. The last one is in java.beans; where the other two are only you can know. If they're not in package "agents", they need to be properly imported.
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic