Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • in reply to: Console.cpp issues #6183
    AvatarYeon Tan

    This is just the screen shot I forgot to upload.


    in reply to: Console.cpp issues #6182
    AvatarYeon Tan

    Dear Juan,

    To my surprise, when I typed /home/utar/Desktop/Castalia/CastaliaBin on the terminal, it shows :

    fuzzylite: a fuzzy logic control library
    version: 6.0
    author: Juan Rada-Vilela, Ph.D.
    license: FuzzyLite License

    usage: fuzzylite inputfile outputfile
    or: fuzzylite benchmark engine.fll input.fld runs [output.tsv]
    or: fuzzylite benchmarks fllFiles.txt fldFiles.txt runs [output.tsv]
    or: fuzzylite [-i inputfile] [-if format] [-o outputfile] [-of format] [-example letter] [-decimals number] [-d file] [-values number] [-scope scope] [-dheader boolean] [-dinputs boolean]

    -i inputfile file to import your engine from
    -if format format of the file to import (fll | fis | fcl)
    -o outputfile file to export your engine to
    -of format format of the file to export (fll | fld | cpp | java | fis | fcl)
    -example letter if not inputfile, built-in example to use as engine: (m)amdani or (t)akagi-sugeno
    -decimals number number of decimals to write floating-poing values
    -d file if exporting to fld, FLD file of input values to evaluate your engine on
    -values number if exporting to fld without datafile, number of results to export within scope (default: EachVariable)
    -scope scope if exporting to fld without datafile, scope of -values: [EachVariable|AllVariables]
    -dheader boolean if true and exporting to fld, include headers
    -dinputs boolean if true and exporting to fld, include input values

    Visit for more information.

    Copyright (C) 2010-2017 by FuzzyLite Limited.
    All rights reserved.

    Obviously, it certainly comes from the console.cpp.

    Yes, I would compile every times I make any changes to figure things out. I would need to use command line ./makemake -> then make , then it would run the compilation. But when I want to run the simulation, which I need to type Castalia -i leach.ini -c General, this problem occurs.

    I agree with you. In Castalia python file, I did use print method to debug the code, I did the same to Console.cpp. As I have been using this Castalia for quite a while, I know how it works. However, since I am very new to Fuzzylite, I only know how to compile the Fuzzylite but I have no idea how it works. In other words, I would like to know more as to how Fuzzylite feeds inputs, how it generates outputs, in what way Console.cpp comes into play, where is the main code user has to look into and so on. The only thing I know from Fuzzylite Documentation is how to compile it and set up linker, which is certainly limited, therefore I wish you can help explain and elaborate more so that we both can save time of each other. I would really appreciate it. Thanks in advance.

    in reply to: Console.cpp issues #6180
    AvatarYeon Tan

    Dear Juan,

    Yes, the value of CastaliaBin is : /home/utar/Desktop/Castalia/CastaliaBin

    Yes, I do agree very much with you that it may have mix entry point because there is no way it can execute Fuzzylite with CastaliaBin path. For the pathToCastaliaBin, ‘-f’, ‘omnetpp.tmp’, ‘-x’, ‘General’ with subproces.check_output, and I have verified that -f and -x options are actually used for Castalia.

    By the way, I tried to compare the output of $PATH between the one excludes Fuzzylite and the one include Fuzzylite after executing Castalia. The outputs are same and are shown as follows:


    Does it mean the path for executing the bin file remains unchanged ? If so, how would it run into Fuzzylite ?

    Regarding the rebuild, if I remove the main.cpp, it would fail to build with the under fuzzylite folder. So what should I do ?

    in reply to: Console.cpp issues #6177
    AvatarYeon Tan

    Dear Juan,

    First of all, thanks very much for your prompt reply.

    However, even I removed the file, the problem still remains the same.

    The only things that confuses me is that : Why is it running into FuzzyLite’s console.cpp ???

    in reply to: Console.cpp issues #6176
    AvatarYeon Tan

    Dear Juan,

    First of all, thanks very much for your prompt reply.

    However, after removing the main.cpp under the src file, the problem still remains the same.

    I have no idea why it would execute the Fuzzylite code because the pathToCastaliaBin is supposed to link /home/utar/Desktop/Castalia/CastaliaBin which is to execute the omnetpp.tmp file.

    The full content of omnetpp.tmp is shown as follows:

    repeat = 1
    SN.field_x = 100
    SN.field_y = 100
    SN.node[*].Application.collectTraceInfo = true
    SN.node[*].Application.constantDataPayload = 2000
    SN.node[*].Application.packet_rate = 1
    SN.node[*].Application.rng-0 = 3
    SN.node[*].ApplicationName = “ThroughputTest”
    SN.node[*].Communication.MAC.backoffType = 2
    SN.node[*].Communication.MAC.collectTraceInfo = true
    SN.node[*].Communication.MAC.dutyCycle = 1.0
    SN.node[*].Communication.MAC.randomTxOffset = 0
    SN.node[*].Communication.MAC.rng-0 = 4
    SN.node[*].Communication.MAC.rng-1 = 5
    SN.node[*].Communication.MACProtocolName = “TunableMAC”
    SN.node[*].Communication.Radio.RadioParametersFile = “../Parameters/Radio/CC2420.txt”
    SN.node[*].Communication.Radio.collectTraceInfo = true
    SN.node[*].Communication.Radio.rng-0 = 2
    SN.node[*].Communication.Routing.collectTraceInfo = true
    SN.node[*].Communication.Routing.netBufferSize = 1000
    SN.node[*].Communication.Routing.percentage = 0.05
    SN.node[*].Communication.Routing.powersConfig = xmldoc(“powersConfig.xml”)
    SN.node[*].Communication.Routing.roundLength = 20s
    SN.node[*].Communication.Routing.slotLength = 0.2
    SN.node[*].Communication.RoutingProtocolName = “LeachRouting”
    SN.node[*].MobilityManager.rng-0 = 0
    SN.node[*].ResourceManager.collectTraceInfo = false
    SN.node[*].ResourceManager.rng-0 = 6
    SN.node[*].SensorManager.collectTraceInfo = false
    SN.node[*].SensorManager.rng-0 = 7
    SN.node[*].SensorManager.rng-1 = 8
    SN.node[0].Communication.Routing.isSink = true
    SN.node[0].xCoor = 0.0
    SN.node[0].yCoor = 0.0
    SN.node[10].xCoor = 0.0
    SN.node[10].yCoor = 90.0
    SN.node[1].xCoor = 50.0
    SN.node[1].yCoor = 0.0
    SN.node[2].xCoor = 60.0
    SN.node[2].yCoor = 0.0
    SN.node[3].xCoor = 70.0
    SN.node[3].yCoor = 0.0
    SN.node[4].xCoor = 80.0
    SN.node[4].yCoor = 0.0
    SN.node[5].xCoor = 90.0
    SN.node[5].yCoor = 0.0
    SN.node[6].xCoor = 0.0
    SN.node[6].yCoor = 50.0
    SN.node[7].xCoor = 0.0
    SN.node[7].yCoor = 60.0
    SN.node[8].xCoor = 0.0
    SN.node[8].yCoor = 70.0
    SN.node[9].xCoor = 0.0
    SN.node[9].yCoor = 80.0
    SN.numNodes = 11
    SN.physicalProcess[*].rng-0 = 10
    SN.wirelessChannel.bidirectionalSigma = 0
    SN.wirelessChannel.collectTraceInfo = true
    SN.wirelessChannel.onlyStaticNodes = true
    SN.wirelessChannel.pathLossExponent = 2.0
    SN.wirelessChannel.rng-0 = 1
    SN.wirelessChannel.rng-2 = 9
    SN.wirelessChannel.sigma = 0
    cmdenv-event-banners = false
    cmdenv-express-mode = true
    cmdenv-interactive = false
    cmdenv-module-messages = true
    cmdenv-performance-display = false
    ned-path = ../../src
    network = SN
    num-rngs = 11
    output-scalar-file =
    output-vector-file = Castalia-statistics.vec
    seed-set = ${repetition}
    sim-time-limit = 2000s

    As you can see, I suspect if it is the problem of ned-path = ../../src. However, provided that pathToCastaliaBin does not relate anything to fuzzylite, I think my concern here is redundant. Any idea how it relates to Fuzzylite ? In other words, anything I can do to track how it runs into fuzzylite?

    in reply to: Integration of Fuzzylite to Castalia Simulator #6155
    AvatarYeon Tan

    Hi Vilela,

    First of all, thanks very much for your reply.

    I did follow the steps provided in README file. I am now able to compile the Castalia Simulator without error.

    However, i am unable to run the simulation with the errors that read : WARNING: unable to determine total simulation runs. I trace the Castalia file, but i am not the expert in that field, so i cannot clearly figure out the problem. The following is the snippet of the Castalia Python file to run the simulation :

    r_castalia = re.compile(“^Castalia\|\s+(.+)$”)
    r_scenario = re.compile(“Scenario:\s(.*)\$repetition=(\d+)$”)
    r_progress = re.compile(“^\*\* Event \#\d+\s+T=(\S+)\s+Elapsed: (\S+)s.+\s(\d+)\% completed”)
    r_newrun = re.compile(“Preparing for running configuration General, run #(\d+)”)
    r_totalrun = re.compile(“Number of runs: (\d+)”)

    for ini in iniList:
    ini_num += 1
    baselabel = label = labelList.pop(0)
    f = open(“omnetpp.tmp”,”w”)
    f.write(“repeat = ” + str(options.repeat) + “\n”)
    for k in sorted(ini.keys()):
    f.write(k + ” = ” + ini[k] + “\n”)
    has_output = 0
    if sys.version_info > (2,7):
    data = subprocess.check_output([pathToCastaliaBin, ‘-f’, ‘omnetpp.tmp’, ‘-x’, ‘General’]).split(“\n”)
    data = subprocess.Popen([pathToCastaliaBin, ‘-f’, ‘omnetpp.tmp’, ‘-x’, ‘General’], stdout=subprocess.PIPE).communicate()[0].split(“\n”)

    if len(data) > 6: data = data[6]
    else: data = “”

    m = r_totalrun.match(data)
    if (m):
    runs = “/” +
    print “WARNING: unable to determine total simulation runs”
    runs = “”

    As you can see , r_totalrun is designed to match the data which is generated by the function subprocess.check_output or subprocess.Popen, it is obvious that problem occurs from here. If I do not include the FuzzyLite external library, I would not have such problem, this makes me wonder if it is my problem or the FuzzyLite’s.

    So could you please give me somes idea how would i resort to in such circumstance ?

    By the way, I tried the example/application, i am able to generate four files, which are example-static-11, example-static-98, example-dynamic-11 and example-dynamic-98, but i do not know how i can generate the output from here. Also, the documentation does not clearly state how to generate output using centroid defuzzificater, hopefully you can tell me how. Thanks in advance.

    Best regards

Viewing 6 posts - 1 through 6 (of 6 total)