Giter Site home page Giter Site logo

Comments (3)

gluc avatar gluc commented on July 19, 2024

Not sure why you believe it doesn't work. Using the the online app at https://ipub.com/dev-corner/apps/ahp/ the following works perfectly fine:

Version: 2.0
Alternatives: &alternatives
  Beach:
    cost: 10000
  Montañas:
    cost: 5000
Goal:
  name: Vacation
  decision-makers:
    #optional node, needed only if not all decision-makers have equal voting power
    - Däd: 0.4
    - Mom: 2/5
    - Kid: 0.2
  preferences:
    Däd:
      pairwise:
      - [Costs, Fön, 4]
      - [Costs, Spa, 9]
      - [Fön, Spa, 4]
    Mom:
      pairwise:
      - [Costs, Fön, 1/4]
      - [Costs, Spa, 1/9]
      - [Fön, Spa, 1/5]
    Kid:
      pairwise:
      - [Costs, Fön, 1/9]
      - [Costs, Spa, 1]
      - [Fön, Spa, 9]
  children:
    Costs:
      preferences:
        Däd:
          pairwiseFunction: 
            function(a1, a2) min(9, max(1/9, a2$cost/a1$cost))
        Mom:
          scoreFunction:
            function(a) 1/a$cost
        Kid:
          priority:
            - Beach: 1/2
            - Montañas: 0.5
      children: *alternatives
    Fön:
      preferences:
        Däd:
          pairwise:
            - [Beach, Montañas, 1/6]
        Mom:
          pairwise:
            - [Beach, Montañas, 2]
        Kid:
        # Often, entering pairwise preferences is lengthy, especially if you
        # have multiple alternatives. Instead, you can enter scores, i.e. rate
        # each alternative on a scale. The scale can be chosen freely. The 
        # priorities are derived as score / sum(scores)
          score:
            - Beach: 5
            - Montañas: 0
      children: *alternatives
    Spa:
      preferences:
        Däd:
          pairwise:
            - [Beach, Montañas, 2]
        Mom:
          pairwise:
            - [Beach, Montañas, 6]
        Kid:
          pairwise:
            - [Beach, Montañas, 1/2]
      children: *alternatives

Can you pls provide a reproducible example of what is not working for you? Ideally as a gist. Thx!

from ahp.

jjcizi avatar jjcizi commented on July 19, 2024

Thx for reply. but when I use the yaml code which you give above, still garbled.
Däd, Montañas,etc. changed to garbled.
But it is indeed normal , works, on the the online app at https://ipub.com/dev-corner/apps/ahp/.
Why?

from ahp.

jjcizi avatar jjcizi commented on July 19, 2024

solved.

x <- readLines("file.yml")
x <- iconv(x,'UTF-8','UTF-8')
writeLines(x,"file.yml")

use icove() to change file to utf-8 ,then works.

thank you very much.

from ahp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.