Is it possible to store generated EMF model directly to CDO? - eclipse-emf

From the document that I have followed, I understood that every element in EMF model to extend CDOObject. Is this mandatory to extend CDOObject? If yes, then I have an EMF model which is actually developed from other team and don't have permission to extend model class CDOObject. Is there any alternative solution in such case??

Using pure EMF-Models with CDO is possible using the CDO Legacy Mode. While this supports models that are not ported to CDO it has some performance implications.
You can activate the legacy mode like this:
CDOUtil.setLegacyModeDefault(true);
CDOTransaction transaction2 = session.openTransaction();
More information can be found here: https://wiki.eclipse.org/CDO/Legacy_Mode

Related

Using sumo's RealisticEngineModel

I figured out that the realistic engine model from plexe (https://github.com/michele-segata/plexe-sumo) was recently integrated into sumo's main code base. My question is: How can I use the model and specify my own engine parameters. Does the engine model have any influence on the vehicle’s emissions? How can I retrieve engine parameters (rpm and gear) via traci?

Save CPLEX preprocessing/aggregation

I'm using the C++ CPLEX API to model MILP problems. CPLEX "simplifies" my models before solving them (i.e., via the aggregator, MILP presolve, substitutions, etc.). When I use the exportModel method of the IloCplex class it only considers the original model.
Is it possible to save the reduced model?
Thank you for your help
It is not possible to do this using the C++ API (you don't have access to the presolve model via the object oriented Concert layers). You can do it programmatically with the C Callable Library or the Python API. Alternatively, you can do it manually with the interactive, like so:
CPLEX> read model.sav
CPLEX> write model.lp
CPLEX> write presolved.pre
CPLEX> read presolved.pre
CPLEX> write presolved.lp
This example assumes that you've exported your original model in SAV format. After following those steps, you'd end up with presolved.lp (the presolved model in LP format). If you wanted to do it programmatically (using one of the API's above), you'd follow the same steps.

LoopBack Model Definition vs json-schema

Newbie: Trying to better understand how Loopback Model Definition relates (if at all) to json-schema. Will I be able to just write a json-schema file and use that as the Loopback Model Definition?
While there are definitely some close similarities between the two, json-schema and LoopBack's model definition are not the same.
If you have existing JSON schemas, you can probably convert those to LoopBack model definitions, but depending on how complex / advanced your schemas are will determine how easy that conversion is.

Load XSD schema model in C++

Is there a C++ library I use to load the XSD schema model?
The goal is to load the actual XSD schema model (eventually from multiple files) in a way that I can then inspect the model elements (i.e., types, cardinality, attributes, even comments if possible). I don't want to use it for XML content but to manipulate/inspect the actual model.
I know that in Java it can be done, for example, with Xerces2 (http://xerces.apache.org/xerces2-j/xml-schema.html), but I looked for something similar in C++ and could not find it.
You could look at the C++ implementation of EMF:
http://modeling-languages.com/emf4cpp-c-implementation-emf/
Then you could use the EMF XSD model:
http://www.eclipse.org/modeling/mdt/?project=xsd
The EMF XSD model is very well engineered, so the only question is around the maturity of the C++ port of EMF.

Get code model from c++ file checked out from tfs

I'm currently building a checkin policy plugin which performs some static code analysis based on the VCCodeModel code model from the VS sdk.
I can get the code model from an active document in a solution via
FileCodeModel fcm = _dte.ActiveDocument.ProjectItem.FileCodeModel;
But if I check out for example a single .cpp and not the whole solution there is no code model available (because it is not part of a solution?).
Is there any way to get access to the code model from a single file checked out from tfs?
Or is there any workaround like building a temp solution?
How can I access the code model for a file via the filepath/name?
Thanks