Skip to content
/ AHP Public

AHP Evaluation of Wave Energy Implementation

Notifications You must be signed in to change notification settings

HatYaz/AHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

  1. Imports:

    • tkinter: Tkinter is the standard GUI library for Python. It provides classes for creating GUI applications.
    • ttk: The ttk module provides access to the Tk themed widget set.
    • messagebox: This module provides a simple way to create message boxes.
  2. Class Definition:

    • AHP_GUI: This class represents the main application window for the AHP analysis.
  3. Initialization (__init__ method):

    • Sets up the main application window (root) with a title.
    • Defines the criteria and alternatives for the AHP analysis.
    • Creates frames (criteria_frame and alternatives_frame) to organize the input fields for criteria weights and alternative scores.
    • Initializes variables to store criteria weights (criteria_weights) and alternative scores (alternative_scores).
    • Creates input fields (Entry widgets) for users to input criteria weights and alternative scores.
    • Creates a "Calculate" button to trigger the AHP calculation process.
  4. Pairwise Comparison (pairwise_comparison method):

    • This method performs pairwise comparison of criteria weights.
    • It creates a pairwise comparison matrix based on the user-provided weights.
    • The pairwise comparison matrix is symmetric, and each element represents the ratio of the weight of one criterion to another.
  5. Calculate Weights (calculate_weights method):

    • This method calculates the weights of criteria.
    • It takes the pairwise comparison matrix as input.
    • Uses NumPy's eigenvector function to calculate the principal eigenvector of the pairwise comparison matrix.
    • Normalizes the eigenvector to obtain the criteria weights.
  6. Normalize Scores (normalize_scores method):

    • This method normalizes the scores of alternatives.
    • It ensures that the sum of scores adds up to 1, making them comparable.
    • This step is necessary to standardize scores across different criteria.
  7. Calculate (calculate method):

    • This method is executed when the user clicks the "Calculate" button.
    • Retrieves criteria weights and alternative scores from the input fields.
    • Performs pairwise comparisons for criteria weights.
    • Calculates criteria weights.
    • Normalizes alternative scores.
    • Ranks alternatives based on their normalized scores.
    • Displays the ranked alternatives in a message box.
  8. Main Window:

    • Creates the main Tkinter window (root).
    • Initializes the AHP_GUI class with the main window.
    • Enters the Tkinter event loop, allowing the GUI to respond to user interactions.

Overall, this code provides a graphical interface for users to input criteria weights and alternative scores, performs AHP calculations, and displays the ranked alternatives based on the analysis.

About

AHP Evaluation of Wave Energy Implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published