I created a new model and anylogic gives me this error and it doesn't download 3d object during simulation.What's wrong?thanks
The dependencies list is a list of all other packages (read models or libraries) that this model requires to run.
If you referenced or dragged an object from one model to another it will create a dependency. See below
I dragged truck from model 39 and placed it on main in model 40.
If you are sure you don't need anymore you can safely remove it.
Related
I'm trying to write a tool that scans through our Unity (2017.4.22) prefabs and scene files to look for Monobehaviour properties that don't exist in a release build. I've created a c# console project (incorporating YamlDotNet 6.1.2), and from this project I refer to Unity's 'Assembly-CSharp-firstpass.dll' and 'Assembly-CSharp.dll' dlls.
I was wondering if anyone has been able to configure YamlDotNet to parse any given prefab/scene file into a generic key/value data structure (with an arbitrary number of nested levels) in memory, so I can iterate it and use reflection to determine if fields exist.
If you're wondering why I need to do this manually, it's because I'm scanning for fields that don't exist in release builds. The only way to do that is to recompile 'Assembly-CSharp-firstpass' and 'Assembly-CSharp' with UNITY_EDITOR removed (and all code from files within a 'Editor' subfolder) culled. I can't do this in-editor (obviously) so that's why this has to be a standalone tool.
Everything I've tried has resulted in crashes. Here's what I tried:
I downloaded the YamlDotNet 6.1.2 source
Tried to deserialize a prefab using Deserialize(...). Received this error: "Encountered an unresolved tag 'tag:unity3d.com,2011:1'"
I then found this custom Type resolver, which I integrated: https://gist.github.com/derFunk/795d7a366627d59e0dbd
I then started receiving this exception: "Exception during deserialization ---> System.InvalidOperationException: Failed to create an instance of type 'UnityEngine.GameObject'"
I'm guessing this is is happening because I'm trying to instantiate a GameObject in an environment that doesn't fully support GameObjects (I am in a standalone C# project after all).
But I don't actually need to instantiate any GameObjects. I just want to parse the values. Does this make sense to anyone? I found a few other questions here but they don't seem to handle YAML files that are at the same complexity as Unity's prefabs.
Thanks in advance,
Jeff
Your guess is correct. Because you are resolving the tag:unity3d.com,2011:* tags to UnityEngine.GameObject and related types, then the deserializer attempts to create an instance of the corresponding type when it encounters the tags.
You could opt to always resolve the tag to Dictionary<string, object> (or Dictionary<object, object> if the keys are not always strings). Then always get dictionaries.
In your case it is probably simpler to load the YAML stream using YamlDotNet.RepresentationModel.YamlStream. This will give you a representation of the YAML document that will be more suitable for your use case.
Here's the official example on how to do it: https://github.com/aaubry/YamlDotNet/wiki/Samples.LoadingAYamlStream
// Load the stream
var yaml = new YamlStream();
yaml.Load(input);
// Examine the stream
var mapping = (YamlMappingNode)yaml.Documents[0].RootNode;
I have created a small Modelica library of my own. The way I have created it is in a single file. But I would like to make it a proper Modelica Library, as in the one with multiple directories for each subpackages.
So this is what i followed. File > New Modelica Class > Specialization - Package > Unchecked Save contents in one file. I copied the entire package code from the single file library, pasted it here and saved it. while doing so, I've noticed that the library lost most of its extends clauses, few models went missing.
Have I followed the correct procedure to create the library or did I do something wrong?
Can anyone point me towards the right direction?
#MSK, I cannot help you with OpenModelica as I work with Dymola. I did however recently split a single-file library (called package in Modelica) into several files manually. I did this so that the library hierarchy is represented in the file system hierarchy (i.e. several subfolders and .mo files in a library folder). For 35,000 lines of code this took roughly 10 hours. Just follow these steps:
create folder with same name as library
in this folder, create a text file "package.mo"
"package.mo" has to start with the statement
within ;
package [name of your package, i.e. the folder name...without the brackets];
now you want to create a subclass within this package. To do this create another folder containing a text file called "package.mo"
start this "package.mo" with
within [name of your package];
and declare the model as usual.
continue all the way down your library hierarchy
at the lowest hierarchy level you no longer need to create folders. You can simply create a .mo with the name of the lowest level class. As usual, start this file with
within [name of your package].[subclass1].[subclass2];
For an example of implementation please refer to the Physiolibrary found at https://www.modelica.org/libraries or the Modelica Standard Library which also uses this structure.
After migrating to Play-2.1 I stuck into problem that routes compiler stopped working for my routes file. It's been completely fine with Play-2.0.4, but now I'm getting the build error and can't find any workaround for it.
In my project I'm using cake pattern, so controller actions are visible not through <package>.<controller class>.<action>, but through <package>.<component registry>.<controller instance>.<action>. New Play routes compiler is using all action path components except for the last two to form package name that will be used in managed sources (as far as I can get code in https://github.com/playframework/Play20/blob/2.1.0/framework/src/routes-compiler/src/main/scala/play/router/RoutesCompiler.scala). In my case it leads to situation when <package>.<component registry> is chosen as package name, which results in error during build:
[error] server/target/scala-2.10/src_managed/main/com/grumpycats/mmmtg/componentsRegistry/routes.java:5: componentsRegistry is already defined as object componentsRegistry
[error] package com.grumpycats.mmmtg.componentsRegistry;
I made the sample project to demonstrate this problem: https://github.com/rmihael/play-2.1-routes-problem
Is it possible to workaround this problem somehow without dropping cake pattern for controllers? It's the pity that I can't proceed with Play 2.1 due to this problem.
Because of reputation I can not create a comment.
The convention is that classes and objects start with upper case. This convention is applied to pattern matching as well. Looking at a string there seems to be no difference between a package object and normal object (appart from the case). I am not sure how Play 2.1 handles things, that's why this is not an answer but a comment.
You could try the new # syntax in the router. That allows you to create an instance from the Global class. You would still specify <package>.<controller class>.<action>, but in the Global you get it from somewhere else (for example a component registry).
You can find a bit of extra information here under the 'Managed Controller classes instantiation': http://www.playframework.com/documentation/2.1.0/Highlights
This demo project shows it's usage: https://github.com/guillaumebort/play20-spring-demo
I'm trying to import some source code into EA, and make packages. In my root class diagram, I want to show each package as a visual grouping and have all classes inside that package in one group.
Can this be done?
Thanks
Not automatically. When you reverse-engineer source code, you have the option of creating either one class diagram in each package, or no diagrams at all.
Doing it manually, you can create a diagram which simply contains the packages: by default, EA lists the contents of each package when the package is placed in a diagram.
You could also drag the classes into the diagram and group them using boundaries or swimlanes. Boundaries are created from the "Common" diagram toolbox, while swimlanes are accessed by right-clicking an empty area of the diagram.
Finally, you can play around with the diagram's properties (also accessed by right-clicking an empty area), specifically the ones concerning namespaces and fully-scoped object names; these affect how EA displays packages and elements in a diagram.
Here is my problem>
We currently have several Ecore models for our applications. One of the Ecore models (mainModel.ecore) has stuff that is common in all the rest of the models. So, what i want to do is have all the other models reference the contents of that one model so we do not have to constantly copy the contents of that one model into all the models every time there is a change.
Is this possible and how can I do this?
(I am very new to Ecore and still do not understand a lot of the terminology.)
EDIT:
How do i get the EcoreUtil.getRootContainer to return the the container of the loaded resource? I need to have that location so that i can resolve certain paths from that root. This may resolve my issue.
Here is what i attempted so far:
I tried "load resource..." by loading the mainModel.ecore into all the other models and deleting the local references. There were a lot of places that i had to fix after doing this and i did. After re-generating the source and trying to compile there are places where it tried accessing the "dotpath" that was local to the original file and i do not know how to change that "dotpath" to reference the "loaded resource". So it is not able to resolve those paths.
Thanks!
You'll generally get answers about EMF more readily by using the EMF newsgroup (eclipse.tools.emf) which is web accessible via
http://www.eclipse.org/forums/index.php/f/108/
Your problem isn't so clear. I don't understand how the compiled code accesses anything via a "dot path". I know if you load a resource and refer to it's contents you'll generally end up with relative paths, but those are normally resolved during loading to an absolute URI. Of course the referencing resource itself needs to be loaded with an absolute URI, but the generator does that properly...