Since Today: Exception when creating a CostmatrixBuilder

Hello.

Since today my program is not running anymore after the following line of code:

VehicleRoutingTransportCostsMatrix.Builder matrixBuilder = VehicleRoutingTransportCostsMatrix.Builder.newInstance(true);

Last time it worked. Does anyone have the same issue?

I can´t tell you what exception because it is some kind of internal jsprit exception and the program end after it.

Hi @patrick_wisniewski19,

If you are using jsprit version 1.6.3-SNAPSHOT, I would guess it might be related to #250.

Best regards,
He

1 Like

Hi Patrick,

Do you always download the latest snapshot automatically and use this in production? If you want to protect your application, you need to think about another policy since the master can change and we cannot always guarantee that this does not break existing code (i.e. we do not break the API).
We did three things that might be important to know:

When understanding you correctly, your error is caused by the second point, so you need to make sure you implement TransportDistance correctly (just add the two new parameters).

Best, Stefan

Hi,

because in the last view days and weeks have come some very nice features I keep updating it. This is realy the first time that I have a conflict with it. I should change the update policy as you said.

But for now the problem leads me to two questions:
Is there a possibility to return to the version that was a view days ago?
In the “POM” File it says:

jsprit jsprit-core 1.6.3-SNAPSHOT jsprit jsprit-analysis 1.6.3-SNAPSHOT

are there some kind of revision i can add to the version?

And my other question: That do you mean with implementing a TransportDistance? My code looks like so:

  1. Create costmatrix
  2. Create VRPBuilder
  3. Add the vehicles
  4. Add the services/jobs
  5. Add the costmatrix
  6. Build the Problem
  7. Build the algorithm with parameters
  8. Search for the best solution

Where in the Code should I now implement the TransportDistance? Actualy my program breaks even before the 1. point: It breaks when I create a empy new matrixbuilder.

Sorry I hope my questions are not too dumb …

Thanks

How do you develop and build your application? Do you run this from an IDE, or do you build binaries and run the application with the binaries?

Actiay, I am running it direcly from the IDE Netbeans. Jsprit is build in as a dependency

Do you use/implement TransportDistance somewhere in your code? If you compile your code then Netbeans should tell you that there is a compilation error somewhere.

Would you mind to just add this to your pom:

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-slf4j-impl</artifactId>
    <version>2.0.1</version>
</dependency>

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.0.1</version>
</dependency>

additionally put a file called log4j.xml in your resource folder. It should have the following content:

<?xml version="1.0" encoding="UTF-8"?>
    <Configuration>
        <Appenders>
            <Console name="STDOUT" target="SYSTEM_OUT">
                <PatternLayout pattern="%d %-5p [%t] %C{2} - %m%n"/>
            </Console>
        </Appenders>
        <Loggers>
            <Root level="info">
                <AppenderRef ref="STDOUT"/>
            </Root>
        </Loggers>
    </Configuration>

This configures the logger. If your program compiles and run, this should log what happens in jsprit. Actually, you should receive exceptions anyway (also without logging).

Hmm it works now somehow like before. I had no compilation error. After the line VehicleRoutingTransportCostsMatrix.Builder matrixBuilder = VehicleRoutingTransportCostsMatrix.Builder.newInstance(true);

I had a thread exception and could not read it with debugging. Maybe my jsprit was somehow broken or my netbeans. After a deep search I don´t use the TransportDistance in any row. Very strange.

So I think this thread can be closed^^ Thanks for all your help.

PS: How far is the status of a release version of 1.6.3? For my problems need its new features like the multiple time window for services and the priorities.