How do I add a new attribute to "sumo" and "veins"? - veins

I'm a beginner.
I'm trying to research how the behavior of a vehicle changes if you set an estimated time of arrival for each vehicle using sumo and veins, and drive according to that time.
Of course, I think it would be difficult to implement this without traffic conditions and a smart navigation system, but I'm thinking of giving it a try.
Now, when I implement it, I want to add an attribute to that is not provided in sumo.
I checked the sumo file and it seems to be set in the C++ file, but I couldn't find where I should add it.
Also, I think I need to make some changes to the veins to process the data after adding it in sumo, where can I look to learn more?
Here are the tools I'm using
sumo (1.8.0) veins (5.1) omnet++ (5.6.2)
I am sorry, but I would appreciate it if someone could push this for me.

If you want to add arbitrary attributes to vehicles, this can be done using what SUMO calls "Generic Parameters". See https://github.com/eclipse/sumo/blob/v1_8_0/docs/web/docs/Simulation/GenericParameters.md for a quick explanation, see https://github.com/sommer/veins/blob/veins-5.1/src/veins/modules/mobility/traci/TraCICommandInterface.h#L167 for a way to access them from OMNeT++.

Related

Does AspectJ support modifying the JDK bytecode?

I want to intercept ClassLoader's loadClass method. In order to show the process of loading class by ClassLoader. But I don't know the working principle of aspectj. It can modify the source code of the JDK?
You could just use a debugger and step through the process in order to understand it.
AspectJ can weave aspects into existing class files during compilation (CTW, compile-time weaving) or during class-loading (LTW, load-time weaving).
LTW does not work for JDK classes because those classes are always loaded before the weaving agent. So you have a bootstrapping problem there.
What you can do, however, is to apply CTW to the class files in e.g. rt.jar from your JRE/JDK distribution, zip the woven class files into another JAR and replace the original one with it. Then if you start the JVM with aspectjrt.jar on the boot classpath, you see the aspects in action. I have done that before and it works. But really, this is not what AspectJ was designed for. But you asked, so I told you. It is a very advanced topic though, and I doubt that it is the road you should take as a complete AspectJ greenhorn - no offense meant.
Update: Because I have been asked this question so often, I created a little demo project showing how to weave aspects into the JRE/JDK. I still do not think it makes sense to use it under normal circumstances, but what the heck: Why do people climb the Mount Everest? Because it exists. ;-)

How to start working on QuickFix library

I have given a project to develop Algorithmic trading system using c++ and quickFix library, I search on google about quickFix library but didn't find any useful information.
Can anybody give me some information , from where should I start?
You provide very little detail in your question, so I can only guess at a helpful approach. I have done what you are starting, in Python, and can give you some orientation. All the links Karl mentioned are crucial, (you should pay special attention to the quickfix documentation on the config file) to which I would add FIXIMATE.
To do something like this in QF you need to answer a number of questions.
Logon. Figure out how to logon. Try to get a data dictionary from your counterparty. You don't want to be forced to modify your DD too much.
Interface. How will you tell QF to logon, logoff, exit terrible positions, and so forth? I use a command line tool (cmd2) that gives me this ability. Other people code GUI windows.
Message Cracking. Some versions of QF come with a cracker but if you don't have it in C++ you will have to write your own so you can parse the incoming messages.
Data Management. How will you save incoming market data, both in RAM and to disk for analysis later? How will you represent and monitor your positions, your working orders, your audit trail? Familiarize yourself with the ScreenLogFactory and FileLogFactory in QF.
Auxiliary Functions. You will need a lot of functions you will write yourself to help at all stages. Save them all in one place and organize them into categories for easy access.
Monitoring. How will you know if something goes wrong (or right) when you are not in front of your computer monitoring the algo? I launch a completely separate process which consumes messages via a queue and sends me texts and emails.
Risk. You don't want your machine sending 1000 orders to market in the blink of an eye. You need to code some checks that will veto bad orders as a final stage before they go out. Also some code that will tell you if you are in a position when you are supposed to be flat. This part is very important.
Strategy. You will need the ability to quickly ingest data, analyze it, and generate signals. For flexibility you should not design your strategy into your system, but you should design a strategy object which can support any strategy you come up with. Then you deploy those objects within your system.
Order handling. Your algo needs to know when and how to enter orders, cancel them, move stops, etc. It will need to deal with partial fills, and be able to support multiple order types.
This is just the beginning, off the top of my head. It is a long road to do all by yourself with no help. Very interesting though, and rewarding.
You can find the QuickFIX downloads on the quickfixengine.org website here: http://www.quickfixengine.org/. From there, you can download either the source code or download pre-built packages for Visual Studio 2010, 2012 and 2013.
Documentation for QuickFIX can be found in their documentation area here: http://www.quickfixengine.org/quickfix/doc/html/. The documentation includes compilation/installation instructions and a "Getting Started" section which discusses setting up a project and writing your first QuickFIX application.
If you wish to know more about the FIX protocol, you are advised to look at the FIX website here: http://www.fixtradingcommunity.org. There are specifications on that website that will give you information on the types of messages supported by FIX and how they should be used.

Alter the appearance of NPC player entities to have a specific skin

I'm creating a bukkit plugin that's making a world in Minecraft outside the ordinary and that includes having NPCs (bots) entities that look like actually players and not villagers. I've already got the bots working programming wise but I want to have each bot have a different skin based upon it's name. Can I do this with maybe a resource pack or something? currently they take the names of Minecraft players with the same name but I'd like to override this.
TL;DR
Can I change the appearance of player entities by name with:
a Resourcepack?
a server side command?
playerConnection.sendPacket?
This is currently not possible without modifications to the client. If you want to, you can use Spoutcraft, but this requires users of the plugin to have the Spoutcraft launcher for the textures to show correctly.
There's no way to do this with the vanilla client, however, short of buying a bunch of Minecraft accounts and assigning them appropriate skins.
You should try out the DisguiseCraft plugin for a quick fix. DisguiseCraft is currently available on the Bukkit website. Do keep in mind that it also requires ProtocolLib to function properly, and you will need to have both installed on your server. You may find a link for ProtocolLib through the DisguiseCraft page. I currently use the two on my server and have had no issues with functionality.
If you would prefer a more direct approach however, since you are coding your own plugin, consider looking over the Lib's Disguises Developer API. Like DisguiseCraft, it too requires ProtocolLib, but the source for Lib's is publicly available and is intended to target developers. Just like DisguiseCraft, you may find a link for ProtocolLib through the Lib's page.

C++ Usage Statistics

I have made an application in C++ and would like to know how to go about implementing a usage statistics system so that I may gather some data regarding how users use the program.
Eg. IP Address, Number of hours spent in application, and OS used.
In theory I know I can code this myself if I must, but I was wondering if there is a framework available to make this easier to do. Unfortunately I was unable to find anything on google.
Though there is no any kind of such framework, you could reduce the work you have to do (in order to retrieve all these information) by using some approaches and techniques, which I tried describe below. Please, anybody feel free to correct me.
Let's summarise, what groups of information do we need to complete the task:
User Environment Information. I suggest you to look at Microsoft's WMI infrastructure, in particular to WMI classes: Desktop, File System, Networking, etc. Using this classes in your application can help you retrieve almost all kind of system information. But if you don't satisfy with this, see #2.
Application and System Performance. Under these terms I mean overall system performance, processor's count, processes running in OS, etc. To retrieve these data you can use the NtQuerySystemInformation function. With its help, you will get an access to detailed SystemProcessInformation, SystemProcessorPerformanceInformation (retrieves info about each processor) information, and much more.
User Related Information. It's hard to find a framework to do such things, so I suggest you simply start writing code, having in mind your requirements:
counting how many times each button was pressed, each text field was changes, etc.
measuring delay time between consecutive actions in some kind of predefined sequences (for example, if you have a settings gui form and you expect from the user to fill very fast all required text fields, so using a time delay measuments can give you an information if the user acted as we expected from him or delayed after TextBox2 for a 5 minutes).
anything that could be interested to you.
So, how you could implement the last item (User Related Information) requirements? As for me, I'd do something like folowing (some may seem very hard to implement or too pointless):
- creating a kind of base Counter class and derive from it some controls (buttons, edits, etc).
- using a windows hooks for mouse or keybord while getting a child handle (to recognize a control, for example).
- using Callback class, which can do all "dirty" work (counting, measuring, performing additional actions).
You could store all this information either in a textfile or an SQLite database or there wherever you prefer.
I would recommend taking a look at DeskMetrics. This StackOverflow post summarizes the issue.
Building your own framework could take you months of development (apart from maintenance). With something like Trackerbird Software Analytics you can integrate a DLL with your app and start tracking in 30 minutes and you get all the cool real-time visualizations.
Disclaimer: I am affiliated with company.

Is anyone using a ColdFusion framework that has specific path requirements without mapping or locating resources in the server root?

Let me first say I am aware of this faq for Mach-II, which discusses using application specific mappings as a third option when:
locating the framework in the server root is not possible and
creating a server wide mapping to the Mach-II framework directory is impossible
Using application specific mappings would also work for other ColdFusion frameworks with similar requirements (ColdSpring). Here is my issue however: my (I should say "their") production servers are all running ColdFusion MX7, and application specific mappings were introduced in ColdFusion 8. I most likely will be unable to do option 1 or 2 because they involve creating server wide changes that could conflict with other applications (I don't have a final word on this but I am preparing for that to be the case).
That said, is there anybody out there who was in similar bind and has done an option 4, in any ColdFusion version, or with any similar framework? The only option 4 I can think of is modifying the entire framework to change this hardcoded path, and even if that worked it would be time consuming and risky. I'm fairly sure that if there was a simple modification or other simple solution it would already be included in the framework (maybe it's included in version 1.8 of Mach-II and I don't know about it yet).
Any thoughts on solving this problem or even unorthodox setups with libraries that have specific path requirements would be appreciated. Any thoughts from Team Mach-II would especially appreciated...we're on the same team here Matt! ;-)
EDIT
Apparently, the ColdBox framework includes a refactor.xml ANT task which includes a target that refactors the ColdBox code to use a different absolute path as a base along with several other useful refactoring targets. So problem solved for ColdBox users.
Looking at the build.xml for Mach-II (1.6 and 1.8) I don't see any target in there that would allow me to refactor the code. I thought about creating a feature request ticket for such a task for Mach-II but frankly I don't think creating such an ANT task is a big priority for the MachII team since the need really only relates to either
a) users of ColdFusion versions below 8
b) someone who wants to use multiple Mach-II versions in the same application, a use I doubt they want to support
The ColdSpring code I have doesn't come with any ANT tasks at all, although I do have unit tests, and I bet if I poked around the SVN I'd find a few build scripts.
Using Ant tasks to refactor and retest the code, or the simpler (and sort of cop out) solution of creating a separate ColdFusion instance for the application are the best answers I've been able to come up with. I don't need this application to exist in the shared scope of other applications, so my first solution is going to be to try and get a dedicated CF instance for this application.
I'm also going to look at the ColdBox refactor.xml ANT task however and see if I can modify it to work generically to recognize and refactor CFC references with modified absolute paths. If I complete this task I'll be sure to post the code somewhere and edit create an answer to link to it. If anybody else wants to take a crack at that or help me out with it feel free.
Until then I'll leave this question open and see if someone comes up with a better solution.
Fusebox is not so strict, I think.
In XML mode (maybe I call this not 100% correcly, just mean using the Application.cfm) it's just proper include in index.cfm, something like:
<cfinclude template="fusebox5/fusebox5.cfm" />
In non-XML mode it will need proper extending in the root Application.cfc:
<cfcomponent extends="path.to.fusebox5.Application" output="false">
All you need is to know the path.
Perhaps you could create a symbolic link and let the operating system resolve the issue for you?
I've been playing with FW/1 lately, and while it may look like you need to add a mapping and extend org.corfield.framework, you can actually move the framework.cfc file into your web root and just extend="framework". It's dead simple, and gets you straight into a great framework with no mess and very little overhead.
It should be as simple as dropping the 'MachII' folder at the root of your domain (i.e. example.com/MachII). No mappings are required to use Mach-II if you just deploy at the root of the domain of your website.
Also:
Please file a ticket for the ANT task you mentioned in your question. Team Mach-II would love to have this issue logged:
Enter a new ticket on the Mach-II Trac
If you want to tackle an ANT task for us, we can get stuff like this incorporated into the builds faster than waiting to for a Team member to work on the ticket. Code submissions from the community are welcome and appreciated.
We don't keep an eye on Stack Overflow very often so we invite you to join our official community group at called "Mach-II for ColdFusion" at Google Groups. The Google Group is the best place to ask questions or comments like this if you want feedback from the Team.