Giter VIP home page Giter VIP logo

coffeeproofofconcept's People

Contributors

angievig avatar joancolina819 avatar seyerman avatar

Watchers

 avatar  avatar

coffeeproofofconcept's Issues

There are problems with the JAVADOC format

There are problems with the JAVADOC format in:

1. In the Parser () and parser (String) methods of the IHlvlParser interface.
2. In the Transformation class with the author.
3. In the CompilationParameters class, in the getSolversJson () method, getOperationsJson (), CompilationParameters ().
4. In the compiler class, in the getSolver method.
5. In the class Splot2HlvlParser, with the Splot2HlvlParser method.
6. In the IhlvlBasicFactory interface, with the getElement, getImplies, getDecomposition, getDecompositionList method.
7. In the FileUtils class (This class is present in two packages, com.coffee.common.utils and com.coffee.modelParsers.utils), with the methods readFileFromDirectory, writeHLVLProgram.
8. In the JsonMng class, with the getfromString method.

Bug with the HLVL transformation rules

There is a small bug with the HLVL transformation rules. because, in some cases, it does not perform the line break.

Example:
This is the XML code:

"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n" + 
				"<featureModel>\r\n" + 
				"    <properties/>\r\n" + 
				"    <struct>\r\n" + 
				"        <and mandatory=\"true\" name=\"EjemploFeatureIDE\">\r\n" + 
				"            <or name=\"Games\">\r\n" + 
				"                <feature name=\"Testris\"/>\r\n" + 
				"                <feature name=\"TRESDCarRace\"/>\r\n" + 
				"                <feature name=\"Chess\"/>\r\n" + 
				"            </or>\r\n" + 
				"            <feature name=\"Task\"/>\r\n" + 
				"            <feature name=\"VideoCall\"/>\r\n" + 
				"            <and mandatory=\"true\" name=\"HardWare\">\r\n" + 
				"                <feature name=\"GPS\"/>\r\n" + 
				"                <feature mandatory=\"true\" name=\"RAM\"/>\r\n" + 
				"                <alt mandatory=\"true\" name=\"Processors\">\r\n" + 
				"                    <feature name=\"GPU\"/>\r\n" + 
				"                    <feature name=\"CPU\"/>\r\n" + 
				"                </alt>\r\n" + 
				"                <feature mandatory=\"true\" name=\"ScreenResolution\"/>\r\n" + 
				"                <feature name=\"TRESGConector\"/>\r\n" + 
				"            </and>\r\n" + 
				"        </and>\r\n" + 
				"    </struct>\r\n" + 
				"    <constraints>\r\n" + 
				"        <rule>\r\n" + 
				"            <imp>\r\n" + 
				"                <var>TRESGConector</var>\r\n" + 
				"                <var>GPU</var>\r\n" + 
				"            </imp>\r\n" + 
				"        </rule>\r\n" + 
				"        <rule>\r\n" + 
				"            <imp>\r\n" + 
				"                <var>GPS</var>\r\n" + 
				"                <not>\r\n" + 
				"                    <var>Chess</var>\r\n" + 
				"                </not>\r\n" + 
				"            </imp>\r\n" + 
				"        </rule>\r\n" + 
				"    </constraints>\r\n" + 
				"    <calculations Auto=\"true\" Constraints=\"true\" Features=\"true\" Redundant=\"true\" Tautology=\"true\"/>\r\n" + 
				"    <comments/>\r\n" + 
				"    <featureOrder userDefined=\"false\"/>\r\n" + 
				"</featureModel>\r\n" + 
				""

This are methods that I'm using

public void addGroup(Node n) {
		if (n.getNodeName().equals("or")) {
			ArrayList<String> names = groupNamesChildrens(n);
			HlvlCode.append("	" + converter.getGroup(findNameInNode(n), names, GroupType.Or));
		} else if (n.getNodeName().equals("alt")) {
			ArrayList<String> names = groupNamesChildrens(n);
			HlvlCode.append("	" + converter.getGroup(findNameInNode(n), names, GroupType.And));
		}
	}
public void addDescomposition(Node n) {
		for (int i = 0; i < n.getAttributes().getLength(); i++) {
			if (n.getAttributes().item(i).getNodeName().equals("mandatory")
					&& (findNameInNode(n.getParentNode()).equals("")) && (!n.getParentNode().getNodeName().equals("or")
							&& !n.getParentNode().getNodeName().equals("alt"))) {
				HlvlCode.append("	" + converter.getCore(findNameInNode(n)));
			} else if (n.getAttributes().item(i).getNodeName().equals("mandatory")
					&& (!findNameInNode(n.getParentNode()).equals("")) && (!n.getParentNode().getNodeName().equals("or")
							&& !n.getParentNode().getNodeName().equals("alt"))) {
				HlvlCode.append("	" + converter.getDecomposition(findNameInNode(n.getParentNode()), findNameInNode(n),
						DecompositionType.Mandatory));
			} else if ((!findNameInNode(n.getParentNode()).equals("")) && n.getAttributes().getLength() == 1
					&& (!n.getParentNode().getNodeName().equals("or")
							&& !n.getParentNode().getNodeName().equals("alt"))) {
				HlvlCode.append("	" + converter.getDecomposition(findNameInNode(n.getParentNode()), findNameInNode(n),
						DecompositionType.Optional));
			}
		}
	}

This is the result

model  Auto_generated
elements: 
	boolean TRESGConector
	boolean ScreenResolution
	boolean CPU
	boolean GPU
	boolean Processors
	boolean RAM
	boolean GPS
	boolean HardWare
	boolean VideoCall
	boolean Task
	boolean Chess
	boolean TRESDCarRace
	boolean Testris
	boolean Games
	boolean EjemploFeatureIDE
relations:
	r0: coreElements(EjemploFeatureIDE)
	r1:group(Games,[Testris, TRESDCarRace, Chess])[1,*]
	r2:decomposition(EjemploFeatureIDE,[Games])<0>
	r3:decomposition(EjemploFeatureIDE,[Task])<0>
	r4:decomposition(EjemploFeatureIDE,[VideoCall])<0>
	r5:decomposition(EjemploFeatureIDE,[HardWare])<1>
	r6:decomposition(HardWare,[GPS])<0>
	r7:decomposition(HardWare,[RAM])<1>
	r8:group(Processors,[GPU, CPU])	r9:decomposition(HardWare,[Processors])<1>
	r10:decomposition(HardWare,[ScreenResolution])<1>
	r11:decomposition(HardWare,[TRESGConector])<0>
	r12: implies(TRESGConector,GPU)
	r13: mutex(GPS, Chess)

There is no line break between R8 and R9

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.