Openmodelica Error no member named 'nominal' in 'struct INTEGER_ATTRIBUTE' - modelica

I'm working on this project with modelica, but i ran into an error. I'll leave the github repo link here: https://github.com/BigMautone/Drones.git
In particular, the error is in the file "communication.mo". I was trying to simulate a communication between 2+ istance of an object, and i use an Integer and an Integer Array to track information about the communication. When i try to run the simulation by terminal, it shows up this error:
no member named 'nominal' in 'struct INTEGER_ATTRIBUTE' ON EVERY INTEGER VALUES!
I don't know what to do, i'm ready to hear your opinion

Related

Timescale missing on the module as other modules have it Verilator error

I am trying to add an accelerator to the rocket chip framework through the MMIO peripheral. I went through the GCD example and was able to build the basic GCD code. I then replaced the GCD with an accelerator which has it's own Config, Parameters and Field information. Now when I try to pass this information to the rocket chip there is a name clash with the freechips.rocketchip.config.{Parameters, Field, Config}. I tried specifying the whole path i.e; accelerator.util.conig.Parameters to distinguish it from freechips.rocketchip.config.Parameters but it still gave me the same error. When I remove my accelerator configs and parameters and pass simple hand made parameters the build is successful, however, when I add my config I get %Error-TIMESCALEMOD and this error is in the generated file which I am not modifying. I tried a work around by altering my verilator options but that goes down a rabbit hole of errors. I have narrowed down the problem to the fact that this is being caused because I am using two different configs both of which have their own Config.scala file shown here Is there a way to fix this problem? I have attached the error with this question.
The problem was with a blackbox, not sure why it was giving me that error, but yes we can mix two different configs having different util.config files. We just have to specify them explicitly.

Why is it that sometimes Swift requires explicitly indicating an argument and sometimes not?

I am trying to use the following library: https://github.com/peek-travel/swift-currency
One of the ways to use it is to do something like this to mean it is 5 dollars in USD:
USD(5.01)
I noticed that in one of my subviews, when I do this, I get the error of:
Compiling failed: missing argument label 'floatLiteral:' in call
Which I can fix by doing USD(floatLiteral: 5), which means the same thing.
Why is it that in some cases in my code I can do USD(5) without an error, and in others I have to explicitly state the argument?
Documentation for USD from API reference is here: https://peek-travel.github.io/swift-currency/Structs/USD.html

Error in referencing function using package

NetBeans 8.2 Patch 2 (Build 201705191307)
My package hierarchy is:
spider;
spider.ui;
spider.ui.output;
My classes w/functions are:
spider.ui.DisplayManager.stateMachine
spider.ui.output.DisplayManager.stateMachine
The duplication of class names and function names is deliberate. All stateMachine functions are static, that is,
public static stateMachine() { }
I attempt to reference the spider.ui.output.DisplayManager.stateMachine in the spider.ui.DisplayManager.stateMachine using:
import spider.ui.output.DisplayManager;
stateMachine() {
spider.ui.output.DisplayManager.stateMachine()
}
and get a "ui" variable not found.
Cannot find symbol
symbol: variable ui
location: variable spider of type JFrame
I would have expected that if there was an error it would be in using duplicate names not in identifying the "ui" in spider.ui.output.DisplayManager.stateMachine() as being wrong.
It is not a great labor to change the names so that they are unique, but can anyone tell me why I get the error message I do?
I apologize and thank you all. This was most definitely an Operator ERROR, that is, it was created by me.
What was pointed out to me was that:
Spider spider; //variable and
o o o
spider.ui.*; // collide
Once "Spider spider;" was removed, the error was cleared.
What mystified me was that the error message said that 'ui' in "spider.ui." was at fault because "ui" was a variable which could not be found. If I had given it an even moment of thought I would have guessed that the compiler was treating "spider" as an variable name and not a package name. But mystified or not, the error went pfft once "Spider spider;" was removed.
Thanks again and I am sorry to have wasted your time.
The good news is that I earned some StackOverflow brouwnie points for giving a faulty analysis about an error. So I am just wonderful.
art

Using matlab code in Octave - Bayes Net Toolbox

I am trying to run Kevin Murphy's Bayes Net Toolbox in Octave and encountering some problems. It doesn't help that I'm a novice at Bayesian networks, Matlab and Octave.
This toolbox was originally written for Matlab. There is a large test file called test_BNT.m which runs through all the functionality in the toolbox. Most of the error messages relate to the difference between & and && in Matlab and Octave. This is easy to fix. However, I've now come across a new problem and I don't know what to do about it.
For instance, the qmr1.m script creates an instance of the pearl_inf_engine class, sets some of the member member variables and passes the instance of the class to another function. Later on, the member variables are accessed again in a different script (parallel_protocol.m). But when this happens, the following message appears:
error: invalid index for class
error: evaluating argument list element number 1
It seems that from one script to another, it has forgotten that the class has any member variables and gives the invalid index message when you try to access them.
Is this a common error with an easy solution? Is something wrong with the path or working directory? Maybe someone else has already converted the BNT to octave and knows what to do?
Edit
I was able to get past this error message. The trick was to read the installation instructions (haha) and run addpath(genpathKPM(<BNT base directory)). genpathKPM.m is a script includes in BNT which adds all the required directories to the path.
After doing this, run test_BNT.m and change & to && and | to || at each line where it gives a warning. This will clear up most of the errors.
However, I'm still unable to run mpe1.m, mp2.m, mildew1.m and some others. The new error message I'm stuck on is:
error: invalid empty index list
error: called from:
error: C:\FullBNT-1.0.7\bnt\BNT\inference\static\#var_elim_inf_engine\find_mpe
.m at line 63, column 5
on this line of code:
eval(['sCPT.T(', sargs, num2str(jj), ')=0;']);
If I can get all the scripts to work, I'll post an answer here with the steps I took to do it.
Edit 2
I was able to get past the problem in the previous edit. Replace
eval(['sCPT.T(', sargs, num2str(jj), ')=0;']);
with
eval(['sCPT.T(', sargs, sprintf('%d',jj), ')=0;']);
The next problem is identical. Just replace num2str in the same way.
This file was apparently contributed by a user of BNT, and not written by the original author. Using eval kind of a hack, I think. A better fix would be to just rewrite the code so it doesn't use eval at all.
There is one more error in draw_graph.m, which was apparently also an outside contribution to the project. I just commented out the call to that function since I'm not interested in drawing graphs right now. After doing this, and continuing to fix shortcircuit operators, all of the tests in test_BNT.m will run.
Still, I won't create an answer for this until I can get draw_graph.m to run, too.
As a significant amount of time has passed, and the answer to the core problem was provided in the question, I will post it here so it will not stay listed as unanswered:
tl;dr: Change a few operators, solve the remaining bugs specified below, and everything works except the drawing of graphs.
Edit
I was able to get past this error message. The trick was to read the
installation instructions (haha) and run addpath(genpathKPM(<BNT base
directory)). genpathKPM.m is a script includes in BNT which adds
all the required directories to the path.
After doing this, run test_BNT.m and change & to && and | to
|| at each line where it gives a warning. This will clear up most of
the errors.
However, I'm still unable to run mpe1.m, mp2.m, mildew1.m and
some others. The new error message I'm stuck on is:
error: invalid empty index list
error: called from:
error: C:\FullBNT-1.0.7\bnt\BNT\inference\static\#var_elim_inf_engine\find_mpe
.m at line 63, column 5
on this line of code:
eval(['sCPT.T(', sargs, num2str(jj), ')=0;']);
If I can get all the scripts to work, I'll post an answer here with
the steps I took to do it.
Edit 2
I was able to get past the problem in the previous edit. Replace
eval(['sCPT.T(', sargs, num2str(jj), ')=0;']); with
eval(['sCPT.T(', sargs, sprintf('%d',jj), ')=0;']);
The next problem is identical. Just replace num2str in the same way.
This file was apparently contributed by a user of BNT, and not written
by the original author. Using eval kind of a hack, I think. A better
fix would be to just rewrite the code so it doesn't use eval at all.
There is one more error in draw_graph.m, which was apparently also
an outside contribution to the project. I just commented out the call
to that function since I'm not interested in drawing graphs right now.
After doing this, and continuing to fix shortcircuit operators, all of
the tests in test_BNT.m will run.

Error when trying to check for internet access with Reachable.h/.m

I have imported Reachable and followed the chosen anser on this thread: Reachability Guide for iOS 4 Everything looks good, apart from a yellow triangle saying "incomplete implementation". Then when I press run I get ten red errors coming from the Reachable.m file, saying things like "ARC forbids explicit message send of release', 'NSAutoReleasePool is unavailable in automatic counting reference mode' and 'Cast of C pointer of type 'void ': to objective-c pointer type 'Reachability' etc. and 'declaration of 'struct sockaddr_in' will not be visible outside of this function [3]' from the Reachable.h file. Any ideas? Maybe the Reachable files are out of date? I have no experience with using C data types etc. and whenever I have to import an extra implementation/header file things seem to go wrong :/.
Apple's Reachability sample code was last updated in 2010. It doesn't use ARC and contains code that is non-trivial to convert to ARC.
The solution is simple:
Set the -fno-objc-arc compiler flag for that file.