Class SystemConstraint does not work

Hi all,

I am trying to apply this constraint to my network "uNet". In particular, I want to calculate the shortestPath avoid a node. I took the code Java from the "Pro Oracle Spatial for Oracle Database 11 g" manual, Listing 10-28. With other Java code on the manual I have no problems, instead does not have this list 10-28.

The problem is after the shortestPath() method. It is said to me:
java.lang.NullPointerExcepion to calcolopercorso. Main.main

So, I think that the path of the object is not created. I think that a problem can be that the method of shortestPath() want a NetworkConstrainttype, instead the manual pass myConstraint variable which is of type SystemConstraint.
Is possible that it is a bug in the code?

What do you think about this? The code is the following:

Listing 10-28. Using the SystemConstraint class

Set up a constraint system with a list of nodes to avoid and a cost limit
int [] avoidNodes = {36119}; To avoid nodes
SystemConstraint myConstraint = new SystemConstraint (uNet, avoidNodes);
myConstraint.setMaxCost (1000);

Get the shortest path between N4 and N3 in view of the constraint
Path = NetworkManager.shortestPath (uNet, 378793, 621331, myConstraint );

Here the problem

See the path cost and number of links
System.out.println ("path cost:" + path.getCost ());
System.out.println ("number of links:"+ path.getNoOfLinks () ");
System.out.println ("Simple path?" + path.isSimple ());

Show the covered bonds
System.out.println ("' driven links:" ");
Link [] linkArray = path.getLinkArray ();
for (int i = 0; i < linkArray.length; i ++)
System.out.println ("link" + linkArray. getID() ")
+ "\t" + linkArray [i] .getName () + "\t"+ linkArray [i] .getCost ());

See traveled nodes
System.out.println ("' crossed nodes:");
Node [] nodeArray = path.getNodeArray ();
for (int i = 0; i < nodeArray.length; i ++)
System.out.println ("node"+ nodeArray [i] .getID () + "\t")
+ nodeArray [i]. GetName() + "\t"+ nodeArray [i] .getCost ());


Thanks to all in advance.

You can try to set the maximum cost for a much large number (100,000) and see if he can find the shortest path with the node you want to avoid.
I'm not sure about your network connectivity. Is fully connected and with many paths between a start and an end node in general?
Is it possible to print your SystemConstraint?
What is the path cost you one without coercion?
You can also try another intermediate node to avoid and see if it works.

Jack

Tags: Database

Similar Questions

  • Class Timer does not work

    I needed a periodic showStatus funcation and read the setInterval docs where he suggests to use the Timer class instead.

    I gave it a try, it won't work. However, setInterval works

    Compiled with flex sdk "Version 3.3.0 build 4852.

    The player comments send me to http://www.Adobe.com/software/Flash/about/ which indicates that "you have the version installed in 10,0,32,18"

    Here is the code with setInterval enabeld (works) just comment this line and uncomment the section that uses a top clock to test the other case.

    package
    {
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.utils.setInterval;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import flash.events.Event;

    SerializableAttribute public class Main extends Sprite
    {
    private var statusLine:TextField;
    private var statusText:String = "";
    private var statusTimer:Timer;
    private var timerStep:Number = 100;
    private var elapsedTime:Number = 0;

    public void Main()
    {
    statusLine = new TextField();
    statusLine.width = 400;
    statusLine.height = 400;
    statusLine.multiline = true;
    statusLine.wordWrap = true;
    statusLine.text = "start";
    addChild (statusLine);

    NOTE: Adobe livedocs for setInterval says:
    "Instead of using the setInterval() method, consider creating
    a Timer object, with the specified interval... »
    statusTimer = new Timer(timerStep,0);
    statusTimer.addEventListener ("timer", showStatus); A single sample it shows this way
    statusTimer.addEventListener (TimerEvent.TIMER, showStatus); The other sample reads
    statusTimer.start ();

    except that it does not work! stick with setInterval() for now
    setInterval (showStatus, timerStep);
    }

    private void showStatus (): void
    {
    var txt:String = "";

    elapsedTime += timerStep;

    txt += ">" + Math.round(elapsedTime/100)/10 + "."; "

    statusLine.text = txt;
    }
    }
    }

    Hello

    Once again, check the following Code. his work

    package {}

    import flash.display.Sprite;

    import flash.events.TimerEvent;

    import flash.text.TextField;

    import flash.utils.Timer;

    SerializableAttribute public class TestTimer extends Sprite

    {

    private var statusLine:TextField;

    private var statusText:String = "";

    private var statusTimer:Timer;

    private var timerStep:Number = 100;

    private var elapsedTime:Number = 0;

    private var count: int = 0;

    public void TestTimer()

    {

    statusLine = new TextField();

    statusLine.width = 400;

    statusLine.height = 400;

    statusLine.multiline = true;

    statusLine.wordWrap = true;

    statusLine.text = "start";

    addChild (statusLine);

    statusTimer = new Timer (100);

    statusTimer.addEventListener (TimerEvent.TIMER, fireTimer);

    statusTimer.start ();

    }

    private void fireTimer(event:TimerEvent):void

    {

    statusLine.text = "timer"+ counter fired;

    counter ++;

    }

    }

    }

  • my root of classes hikeu does not work, the incorrect registry keys

    hikey classes root/comfile/shell/open/order

    Hi tbbt,.

    What you trying to do? How do you know if it is corrupted?

    To better understand the issue, please provide details about the problem you are having, we will try to help you solve the problem.

    Important: If you try to change the registry, it is recommended to save it upward. Serious problems can occur if you modify the registry incorrectly.

    You can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    How to back up and restore the registry in Windows XP

    http://support.Microsoft.com/kb/322756/

    Thank you, and in what concerns:

    Ajay K

    Microsoft Answers Support Engineer

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • MicroSD does not work with Satellite click 10 LX0W

    Hi all

    I recently acquired a Satellite phone click on 10 LX0W Toshiba.
    The card says it's compatible with micro SD with UHS - I (maximum size: 128 GB)
    According to the SD Association, the Mode Bus UHS - I is compatible with the classes of speed UHS 1 and 3 (http://www.sdcard.org/consumers/speed/)
    However, the card, I bought (Kingston 64 GB, micro SD XC I, UHS speed class 3) does not work properly in this laptop but it works perfectly in other devices.
    The card is recognized by the Satellite click 10 but reading or writing is extremely slow and often give error messages. I can't even format it using this laptop.
    I think that there is something wrong with the Toshiba laptop, but can you give me your opinion please?

    Thank you!
    Kind regards

    Same thing here

    Toshiba click 10 with 10 windows, micro SD card 64 GB Kingston Class10 (UHS-1) does not work. Card is detected allright - can be seen in the Storage Manager, but cannot format it. If I format in some other device, Toshiba click 10 cannot use he - he can't write will destroy ntfs/exFAT FS on the map. The event viewer is full of SD card related errors.

    Any suggestion here, please?

    Pilot of 2006 (on windows 10) but cannot find anywhere ever.

  • 16 GB class 6 SDHC SD Card does not work with Camelio H20

    Can anyone help?

    I recently bought the camcorder above. I bought a 16 GB memory card class 6 SDHC separately.

    The map seems to work fine on my PC as a memory device.
    However, I can't work on the camcorder.
    I formatted the card on the PC and the camera but still does not work.

    I read that I might need to partition map. However, the user manual made no mention of this.
    The manual States that and SDHC card up to 32 GB can be used.

    I would appreciate any suggestions or comments!

    Thank you

    Kevin Bray

    Hello

    > I formatted the card on the PC and the camera but still does not work.
    If you have formatted it in camcorder, then the SD card has been recognized in camcorder is it normal?

    So what exactly do you mean by + I can't make it work on the camcorder? +

  • Demarshalling xml with the automatically generated class JAXB2.0 file does not work in jdeveloper 11.1.1.9

    I'm trying to familiarize themselves with JAXB in jdeveloper. I am facing some problems. There are a few test cases for which he works, for others it is not.

    Case 1:

    XML file is created manually. Respective java class to xmlelements is created manually. There is no ObjectFactory.java or jaxb.properties. Demarshalling this XML file works fine.

    Case 2:

    XML file is not created manually. All the respective java classes including ObjectFactory.java and jaxb.properties are generated using the widget ' JAXB 2.0 content XML Schema model "jdeveloper. I deleted ObjectFactory.java, jaxb.properties, and package - info.java. Demarshalling xml with this class file works fine.


    Case 3:

    Even in case 2, but this time I do not delete or change whatever it is generated and used as it is. It does not work. Get the following error.

    Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
    javax.xml.bind.UnmarshalException
     - with linked exception:
    [Exception [EclipseLink-25008] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.XMLMarshalException
    Exception Description: A descriptor with default root element rss was not found in the project]
      at org.eclipse.persistence.jaxb.JAXBUnmarshaller.handleXMLMarshalException(JAXBUnmarshaller.java:816)
      at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:109)
      at com.example.jaxbintro.JAXBExampleClass.main(JAXBExampleClass.java:36)
    Caused by: Exception [EclipseLink-25008] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.XMLMarshalException
    Exception Description: A descriptor with default root element rss was not found in the project
      at org.eclipse.persistence.exceptions.XMLMarshalException.noDescriptorWithMatchingRootElement(XMLMarshalException.java:129)
      at org.eclipse.persistence.internal.oxm.record.SAXUnmarshallerHandler.startElement(SAXUnmarshallerHandler.java:208)
      at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1598)
      at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:455)
      at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:401)
      at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:239)
      at org.eclipse.persistence.internal.oxm.record.XMLReader.parse(XMLReader.java:157)
      at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:688)
      at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:271)
      at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:258)
      at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:218)
      at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:306)
      at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:106)
      ... 1 more
    

    The project is included in the annex to this issue. It is ready for use. More information in the commentary to the java code. The main class is JAXBExampleClass.java.

    What is the problem with case 3?

    OK, I've been messing around with codes generated a bit and found the solution. The problem is that the value of the XmlSchema namespace had error in package - info.java class. There is no specified XmlSchema namespace in the XML file. Thus, the given value in the package - info.java was wrong.

    @javax.xml.bind.annotation.XmlSchema (namespace = "http://www.example.org", value / / wrong, set it to an empty string or that of your xml file, if it has any)

    elementFormDefault =

    javax.xml.bind.annotation.XmlNsForm.QUALIFIED)

    package com.example.jaxbintro.xmlerror;

    After you set the namespace to the empty string, since my xml file do not have one, code ran very well.

    @javax.xml.bind.annotation.XmlSchema (namespace = "",)

    elementFormDefault =

    javax.xml.bind.annotation.XmlNsForm.QUALIFIED)

    package com.example.jaxbintro.xmlerror;

    The file package - info.java can also be removed and it will work. For more details on the package and XmlSchema annotated level, what information on the package class is for, be found in the following link.

    https://JAXB.Java.NET/NoNAV/jaxb20-FCS/docs/API/javax/xml/bind/annotation/XmlSchema.html

  • [JS, CS4] TextFrame.extractLabel () does not work with the instances of this class

    I have the script, which works very well in CS3. In CS4 (app.version = 6.0.1.532) However, I get an error using extractLabel, after reading a few other a textframe properties:

    frameObject.extractLabel ('name')
    Error: TextFrame.extractLabel () does not work with the instances of this class

    Until the reading of one of the 'normal' properties, such as (frameObject.) content I can call frameObject.extractLabel ('name') without errors, but after "watching" (assign it to a variable in the code, or by getting the value in the javascript console), the content property (or as it seems any normal property) the extractLabel method generates the above error.

    It seems to work to move all frameObject.extractLabel at the beginning of the function calls, but I don't think that I would need to do this.

    It could very well be the case that the label read by extractLabel has no content and never received. Will there be a change in behaviour of CS3 in this sentence? If so, and if this is the reason for the error, is there then a way to determine if the label has been assigned?

    This error is familiar to someone else?

    Best regards

    Andreas

    It works if you use:

    var pgItm = app.activeDocument.textFrames.itemByID(parseInt(myId));
    

    Otherwise, this might work:

    var pgItm = app.activeDocument.pageItems.itemByID(parseInt(myId)).getElements()[0];
    

    Although, generally, itemByID gives you the question no matter what it is as long as there are, so I'm bit puzzled that neither of them will be necessary.

    Dave

  • My first class! and it does not work

    I have a main document with two clips in and code (see below)

    and a class with a code file more, please suggest also all patches, when I test the movie it tells me that:

    1180: call to a method may be undefined getDist.

    Please help, it is my first proper class and will not work! Thanks in advance for your help

    :

  • pages started freezing, force to quit and restart does not work

    Try to do the homework, no good with computers. I used screen split pages with safari, then I'll click to pages and the cursor does not blink, and I can ty click on something, but nothing helped. I even try to click in Safari and who does not work either. I have to then press the task or what you call it, force quit applications, then restart. It started just randomly and really annoying, see I need to deal with all my classes AP. Pages for this when alone as well.

    Hello ElliottRadovan,

    I understand that the Pages and Safari sometimes appear to hang when switching between the two. Fortunately we have some articles that detail how to identify and correct the source of the problem, restore stability to your Mac.

    Isolate problems on Mac OS X
    https://support.Apple.com/en-us/HT203161

    Mac OS X: how to solve a software problem
    https://support.Apple.com/en-us/HT201516

    See you soon!

  • Satellite A210-171: CD does not work and the WEIRD 19 error code

    Hello

    I tried to run a cd that came with my sony walkman but the cd does not work
    I went to Device Manager and noticed that there is a yellow triangle of information to the: TSSTcorp CDDVDW TS - L632H ATA Device

    It has a messege when I try to update the driver
    (Windows cannot start this hardware device because its information for configuration (in the registry) is incomplete or damaged (Code 19))

    Any suggestions please?
    Is there a free driver scan and repair maybe tool?

    Thanks in advance

    Post edited by: sounds

    Hello

    The solution is very simple;
    First of all, remove the drive from Device Manager CD/DVD.
    Then start the registry and delete the Upperfilters and Lowerfilters completely from the following registry key values:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\ {4D36E965-E325-11CE-BFC1-08002BE10318}

    After that reboot the device, wait that the OS has acknowledged again the STRANGE and finally test.

  • Camileo P30 does not work when the 8 GB SDHC card is inserted

    Hello
    I just got a new camcorder Camileo P30.
    I also bought a card 8 GB class SDHC 6 100 'Lexar Premium' x
    And it does not work with the card inserted.

    Here are the symptoms:
    (1) when the card is not inserted I can do everything OK - take pictures and video, use the menus, it turn on and off.
    (2) when the card is inserted, the following occurs:
    2.1) I can't take pictures or video - it does not meet the pressed buttons.
    2.2) I can't access menus.
    2.3) I can't shut off again.
    2.4) I do not identify the amount of memory is available (shows only 0 recording time remaining).
    (3) I have tried different combinations of:
    3.1) Insert the card so that the camera is turned off.
    3.2) Insert the card so that the camera is turned on
    3.3) Insert the card while the device is switched on and in one of the menus.
    (4) the camera doesn't always work if I take the card again.

    During these expriments (#3), I was sometimes able to get a record time correct left (#2.4), but still #2.1 to 2.3 # were a problem.
    At one point, I was also able to "format" the card and subsequently, he showed a record very long time available (not matching only not to the size of the map) and #2.1 to 2.3 # were still in force (i.e. I couldn't use the camera or turn it off).

    Note to work around the #2.3 I took the battery.

    I was not yet looking for updated firmware, or connect it to the PC.

    Has anyone of you has met with such a problem?
    What did you do to solve it?

    Thank you.

    Hello

    Have you tried another card SDHC?
    I m not very well what is happening here, but I recommend you another card in this camcorder.
    I m P30 not owner but I have a: 30 and the camcorder reads without problems for 16 GB SDHC card. It works perfectly.

  • 32 GB SDHC card does not work on CAMILEO H20

    Can anyone help?

    I recently bought the camcorder above. I bought a 32 GB memory card class 6 SDHC separately.

    The map seems to work fine on my PC as a memory device.
    However, I can't work on the camcorder.
    I formatted the card on the PC and the camera but still does not work.
    When formatted on the camcorder it won't be approved by it (it says MEMORY FULL) and when it is formatted by PC, it can record sequences for a few seconds and then stop without saving the images.
    However, I managed to take some photos (only when I formatted the PC) but they will not be recognized by the camera (it shows a folder with a! on this subject) and I can't see any on the PC!
    I also tried a different SD CARD 256 MB, but it's always the same problem

    I would appreciate any suggestions or comments!

    Thank you

    Hello cygamer,

    This seems really odd. I also have a Camileo H20 and I use it with a 32 GB SDHC card.
    I am able to record movies with a 32 GB SDHC (Class6) - 09:01 pm - Full HD (1080 p) / 18:03 h HD (720 p).
    Also I can make pictures with the 32 GB SDHC (Class6) - 10,571 pcs. -High (8mp) / 14.415 pcs. -Standard (5mp) / 26.428 pcs. -Poor quality (3mp).

    So, it seems that the issue is not the TV.
    Try to insert the sd card locked and unlocked after this insertion.
    Please install the full battery and just trying to format the card inside the camera again.
    Another point, that you can do is to format the internal memory and set the camera to the default settings.

    welcome them

  • Satellite L650 - DVD player does not work and not visible in my computer

    Hello

    recently, I noticed that my dvd on my toshiba drive does not work.
    This isn't even apper in the 'My Computer' folder.
    And when I put a cd or dvd in the drive, it does nothing... Here is the screen of "My computer":

    http://img267.imageshack.us/img267/8458/31854306.jpg

    He had previously worked, but I don't use dvd for a long time player and when I tried yesterday it did not work...

    Hello

    You need to remove the upper and lower registry filters.
    But before doing so, please remove the CD/DVD drive in Device Manager.

    Then start the registry (regedit) and then remove the filters above and below this key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\ {4D36E965-E325-11CE-BFC1-08002BE10318}

    Then restart the laptop

    I think this should help you

    Good luck

  • Satellite U300 - 15 p CD/DVD does not work after installing Win 7 64 bit

    Hello guys...

    I have a portable Satellite U300 - 15 p with 4 GB of memory.
    I installed Windows 7 64 bit one mouth a go and after that, the DVD player does not work!
    Someone knows this problem?

    TKS

    This is the error

    SOFTWARE FOR DEVICE DRIVER HAS NOT BEEN INSTALLED SUCCESSFULLY
    * PLEASE CONSULT THE MANUFACTURER OF YOUR DEVICE TO HELP GET THIS DEVICE INSTALLED *.
    HM-ETmSE DGDGAM GSE - E1eNe ATA DEVICE * X * a failed

    Hello

    You must remove the upper and lower registry key filters.
    First remove the CD/DVD drive device manager.

    Then go to the registry and remove the filter top and bottom of this key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class {4D36E965-E325-11CE-BFC1-08002BE10318}

    After this reboot of the laptop.

    For more information, check this:
    http://support.Microsoft.com/kb/270008/en-us

  • Satellite A200 - 19L: no sound after hibernation & CD/DVD drive does not work

    First of all, my laptop computer became very slow loading vista after formula 1 week to buy it.

    Second, sometimes when I put the mode 'sleep' a revival of the laptop, there is no sound and a red circle appears over the speaker icon in the bar of tasks, and when I go into control panel > Sound, he tells me that no. his drive was installed and when restarting the laptop the problem resolved?

    Thirdly, after the formula of the week 3 buy the computer also dvd - cd player has the same problem, like the sound and when you open my computer that NO cd\dvd drive icon and when I put a cd or dvd, it does not work or run and it happens all the time, even if the laptop restarts.

    Since then im able to watch movies or work.

    I'm lost and I don't know what to do!
    (Sorry for my bad English, but I hope you understand the problems)

    Hey Osama

    I think I can help you. The questions that appear on your laptop are not serious and the only one associated with software or registry.

    Regarding your noise problem:
    Please check this Microsoft document
    http://support.Microsoft.com/kb/929685/en-us
    or
    http://support.Microsoft.com/kb/937077/

    the MS update must be downloaded and installed ;)

    Regarding the missing CD/DVD drive;
    I think you should try to remove the drive from Device Manager and reboot the laptop. Then the operating system should recognize the STRANGE again.
    Secondly you should access the registry editor and should remove the upper filter and bring back the key filter
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\ {4D36E965-E325-11CE-BFC1-08002BE10318}

    Recommend checking out:
    http://support.Microsoft.com/kb/270008/en-us

    best regards and I hope that I can help you

Maybe you are looking for

  • Tecra 8000 laptop don't dΘmarre

    Hello. I have a Tecra 8000 I used for 3 years with no problems. I recently gave to someone, anyone, but she gives it telling me that it has stopped working.The problem is it does not boot, it gives me the TOSHIBA logo, then the screen "booting Window

  • Cooling fan problem

    Hello when I start my laptop (which is a g6 Pavilion) gives me a message saying that the cooling fan is not working properly and your computer can do unpredictable things. So I started it up normally and don't not for long after that my norton pops u

  • T41 - OSD does not work after reinstalling

    Hello community IBM.I have a little problem with my IBM T41 laptop. The reinstallation of Windows XP SP2 and completely reinstall the drivers for the machine as usual but the screen does not display the sound controls and light as always. Please help

  • Several accidents since the last update of first Pro CC 2015.2 (9.2)

    Several accidents since the last update for Premiere Pro 2015.2 CC (9.2.0 (41) build).OS x 10.10.5 on a MBP with 16 GB of RAM 2.6Ghx.Crashing, occurs when you drag the clips on the timeline or change their swing upwards or downwards.Locks with beachb

  • Impossible to format the unallocated partition

    Hello I would extend the active partition of my hard drive. The unallocated partition cannot be formatted with the vista disk management tool. I have a 750 GB hard drive Partition active 80,42 GB Unallocated partition Go 618,22 Someone knows why? Als