Controlling customer type for a game

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Controlling customer type for a game

Porag
Hi

Is there any way to control the type of customers for a specific game? Suppose I want all the customers' electric vehicle only. Do I need to modify the bootstrap data for that?

Thanks in advance,
Porag
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

grampajohn
Administrator
Porag wrote
Is there any way to control the type of customers for a specific game? Suppose I want all the customers' electric vehicle only. Do I need to modify the bootstrap data for that?
There are a couple ways you might do this:
- You could modify powertac-server/pom.xml to remove some customer models from the <modules> list.
- In general, customer characteristics, including population, are specified in config files. The compiled-in config files are in the src/main/resources directories in each model source tree. In general, you can override these configurations by modifying server-distribution/config/server.properties. Unfortunately, there is no clear standard about how customer models are configured, since each was written by a different contributor. I've been looking at standardizing it, but it's kind of a big job and it's not (yet) at the top of my list.

Note that some config files are in properties format, while others are xml structured info. The conversion is pretty simple, and after you've done a few you are likely to think the xml format is much easier to read. So for example if you look at the (xml) config file in the customer-models module, the first property is a list of instance names. In properties format, this would be
  customer.coldstorage.coldStorage.instances = seafood-1,seafood2,...

Does this help?

John
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

Porag
Thank you John for the reply. I have downloaded the powertac-server code from here (https://github.com/powertac/powertac-server). When I am trying to run it using "mvn -Pweb2" command, I am getting this error. Do you know why this is happening?

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.powertac:powertac-server:1.6.0-SNAPSHOT: Could not find artifact org.powertac:powertac-parent:pom:1.6.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 19, column 11
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.powertac:powertac-server:1.6.0-SNAPSHOT (C:\Users\Porag\Desktop\Files\Research\PowerTAC\powertac-server-code\powertac-server\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.powertac:powertac-server:1.6.0-SNAPSHOT: Could not find artifact org.powertac:powertac-parent:pom:1.6.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 19, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Thanks
Porag
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

grampajohn
Administrator
Porag wrote
Thank you John for the reply. I have downloaded the powertac-server code from here (https://github.com/powertac/powertac-server). When I am trying to run it using "mvn -Pweb2" command, I am getting this error. Do you know why this is happening?
...
I think you are having two small problems. First, you need to build the server and install it locally. In powertac-server, do
   mvn clean install

Second, you need to run the server (using mvn -Pweb2) from the server-distribution directory. If you don't have that, you'll need to download it from https://github.com/powertac/server-distribution/archive/master.zip.

Does this help?

John
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

Porag
I tried to do that John. But still getting this error.

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.powertac:powertac-server:1.6.0-SNAPSHOT: Could not find artifact org.powertac:powertac-parent:pom:1.6.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 19, column 11
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.powertac:powertac-server:1.6.0-SNAPSHOT (C:\Users\Porag\Desktop\Files\Research\PowerTAC\powertac-server-code\powertac-server\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.powertac:powertac-server:1.6.0-SNAPSHOT: Could not find artifact org.powertac:powertac-parent:pom:1.6.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 19, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Do I need to build the modules separately?
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

grampajohn
Administrator
Porag wrote
I tried to do that John. But still getting this error.

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.powertac:powertac-server:1.6.0-SNAPSHOT: Could not find artifact org.powertac:powertac-parent:pom:1.6.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 19, column 11
...
Ouch! This is also happening to me now. I'm getting too sleepy to make progress on it tonight, it will have to wait until tomorrow.

Sorry -

John
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

grampajohn
Administrator
In reply to this post by Porag
Porag wrote
I tried to do that John. But still getting this error.

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.powertac:powertac-server:1.6.0-SNAPSHOT: Could not find artifact org.powertac:powertac-parent:pom:1.6.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 19, column 11
For the time being, it works if you also download powertac-core and do a local install (mvn clean install) before trying to build powertac-server. This should not be necessary, and I have confirmed that powertac-parent 1.6.0-SNAPSHOT is indeed available in the snapshot repo at Sonatype.

More tomorrow -

John
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

Porag
Thanks for the quick replies, John. It's OK. I can wait until you fix it. Just let me know. :)

Thanks for your help.

Regards,
Porag
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

grampajohn
Administrator
In reply to this post by Porag
Porag wrote
I tried to do that John. But still getting this error.

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.powertac:powertac-server:1.6.0-SNAPSHOT: Could not find artifact org.powertac:powertac-parent:pom:1.6.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 19, column 11
 ...
We now have a fix for this problem -- Issue #993. You will have to pull down the update to do independent builds of the powertac-server module. If you cloned the server repo, then you just have to do git pull origin to get the update.

Cheers -

John
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

Porag
This post was updated on .
Hi John,

Thanks for the fix. I was able to build and run the server. But I wasn't able to register a user to run a simulation. Registration was always failing in the UI. Can you please let me know what should I do to fix this? [N.B. I copied my old user accounts to server-distribution and used my old username, password to login to the simulation environment as a temporary solution]


FYI, I made a change in the pom.xml i.e. commenting out some customer modules

  <modules>
    <module>server-interface</module>
    <module>accounting</module>
    <module>auctioneer</module>
    <module>balancing-market</module>
    <module>customer-models</module>
   
    <module>default-broker</module>
    <module>distribution-utility</module>
    <module>factored-customer</module>
    <module>genco</module>
   
   
    <module>logtool-core</module>
    <module>server-main</module>
    <module>visualizer2</module>
  </modules>

I did mvn clean install and ran a bootstrap simulation. While running the bootstrap simulation I see that the total number of customers are around 57K. After finishing the simulation when I open the boot file, I see that there are electric vehicles which I commented out in the pom file. Can you please tell me why this is happening?

I tried to comment out <module>customer-models</module> and wanted to keep factored-customer only. When I try to do it, I get an error. How can I run a simulation of 10 consumption type factored-customer only?

Thanks in advance
Porag
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

grampajohn
Administrator
It took a couple of tries, but I was able to build and run a server without customer-models or evcustomer. It turns out there are three places in the server that list dependencies on the customer model modules. These are powertac-server/pom.xml, powertac-server/logtool-core/pom.xml, and powertac-server/server-main/pom.xml. Even if you don't do a local build of those modules, the dependencies will download them from the maven repo. So here's what you need to do:

1. clean out ~/.m2/repository/org/powertac
2. do mvn clean on powertac-server. If you've already modified powertac-server/pom.xml, you may need to run mvn clean on individual modules to get rid of the compiled jar files.
3. remove the customer models you wish to exclude from powertac-server/pom.xml
4. remove the dependencies on the unwanted customer models from logtool-core/pom.xml and server-main/pom.xml
5. run mvn clean in server-distribution. You should not see a directory named 'target'.

Now you should be able to run mvn clean install in powertac-server. After doing that, make sure you don't see the unwanted modules in ~/.m2/repository/org/powertac.

If all is well at this point, you should be able to run the server with just the desired modules. Sorry it's so complicated; maven is very good at resolving dependencies, so you need to make sure you've cleaned them all out before you start.

Hope this gets you going. Sorry to took so long to figure it out.

John
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

Porag
Hi John,

After doing all the 4 steps, when I run mvn -Pweb2, I am getting this error.

[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
        at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:804)
        at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:751)
        at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:313)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.652 s
[INFO] Finished at: 2018-12-02T23:29:37-07:00
[INFO] Final Memory: 26M/323M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default-cli) on project server-distribution: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

grampajohn
Administrator
Porag wrote
After doing all the 4 steps, when I run mvn -Pweb2, I am getting this error.
Wow. I cannot find anything in there that gives me a clue to what's wrong, and it worked when I tried it. I assume you have done a local install (mvn clean install) of powertac-server. In your ~/.m2/repository/org/powertac you should see all the server modules other than the customer modules you have omitted. If so, this may be a time to get a colleague to sit down with you and walk through it carefully to see if you've missed something. I sometimes do this with my wife, who has no clue what any of it means, but just the effort of trying to explain it to someone else will sometimes uncover the problem.

I'm sorry I cannot be more helpful at the moment. If I think of anything else, I'll let you know.

John
Reply | Threaded
Open this post in threaded view
|

Re: Controlling customer type for a game

gbuijs
This looks suspiciously like there's already a 'web2' running in the background.
You could check this by opening localhost:8080 in a browser.

Are you running on Windows?
Windows annoyingly forks into the background when you run a maven command.
So you can't kill the Java process with Ctrl-C.

You can kill the process in the Process Manager or reboot to fix the issue.